Skip to content

Commit a3c7884

Browse files
authored
StroeerCore Bid Adapter: use a random UUID for the request id (#10206)
1 parent 7e11273 commit a3c7884

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

modules/stroeerCoreBidAdapter.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {buildUrl, deepAccess, getWindowSelf, getWindowTop, isEmpty, isStr, logWarn} from '../src/utils.js';
1+
import { buildUrl, deepAccess, generateUUID, getWindowSelf, getWindowTop, isEmpty, isStr, logWarn } from '../src/utils.js';
22
import {registerBidder} from '../src/adapters/bidderFactory.js';
33
import {BANNER, VIDEO} from '../src/mediaTypes.js';
44
import {find} from '../src/polyfill.js';
@@ -50,8 +50,7 @@ export const spec = {
5050
const refererInfo = bidderRequest.refererInfo;
5151

5252
const basePayload = {
53-
// TODO: fix auctionId leak: https://github.com/prebid/Prebid.js/issues/9781
54-
id: bidderRequest.auctionId,
53+
id: generateUUID(),
5554
ref: refererInfo.ref,
5655
ssl: isSecureWindow(),
5756
mpa: isMainPageAccessible(),

test/spec/modules/stroeerCoreBidAdapter_spec.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {spec} from 'modules/stroeerCoreBidAdapter.js';
33
import * as utils from 'src/utils.js';
44
import {BANNER, VIDEO} from '../../../src/mediaTypes.js';
55
import {find} from 'src/polyfill.js';
6+
import sinon from 'sinon';
67

78
describe('stroeerCore bid adapter', function () {
89
let sandbox;
@@ -51,8 +52,6 @@ describe('stroeerCore bid adapter', function () {
5152
assert.notProperty(bidObject, 'ad');
5253
}
5354

54-
const AUCTION_ID = utils.getUniqueIdentifierStr();
55-
5655
// Vendor user ids and associated data
5756
const userIds = Object.freeze({
5857
criteoId: 'criteo-user-id',
@@ -72,7 +71,6 @@ describe('stroeerCore bid adapter', function () {
7271
});
7372

7473
const buildBidderRequest = () => ({
75-
auctionId: AUCTION_ID,
7674
bidderRequestId: 'bidder-request-id-123',
7775
bidderCode: 'stroeerCore',
7876
timeout: 5000,
@@ -394,14 +392,18 @@ describe('stroeerCore bid adapter', function () {
394392
clock.tick(13500);
395393
const bidReq = buildBidderRequest();
396394

395+
const UUID = 'fb6a39e3-083f-424c-9046-f1095e15f3d5';
396+
397+
const generateUUIDStub = sinon.stub(utils, 'generateUUID').returns(UUID);
398+
397399
const serverRequestInfo = spec.buildRequests(bidReq.bids, bidReq);
398400

399401
const expectedTimeout = bidderRequest.timeout - (13500 - bidderRequest.auctionStart);
400402

401403
assert.equal(expectedTimeout, 1500);
402404

403405
const expectedJsonPayload = {
404-
'id': AUCTION_ID,
406+
'id': UUID,
405407
'timeout': expectedTimeout,
406408
'ref': 'https://www.example.com/?search=monkey',
407409
'mpa': true,
@@ -429,8 +431,9 @@ describe('stroeerCore bid adapter', function () {
429431

430432
// trim away fields with undefined
431433
const actualJsonPayload = JSON.parse(JSON.stringify(serverRequestInfo.data));
432-
433434
assert.deepEqual(actualJsonPayload, expectedJsonPayload);
435+
436+
generateUUIDStub.restore();
434437
});
435438

436439
describe('video bids', () => {

0 commit comments

Comments
 (0)