Skip to content

Commit

Permalink
convert bidders: glomex
Browse files Browse the repository at this point in the history
  • Loading branch information
dgirardi committed May 20, 2022
1 parent 9feb6f5 commit 37c735a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion modules/glomexBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ export const spec = {
data: {
auctionId: bidderRequest.auctionId,
refererInfo: {
// TODO: this collects everything it finds, except for canonicalUrl
isAmp: refererInfo.isAmp,
numIframes: refererInfo.numIframes,
reachedTop: refererInfo.reachedTop,
referer: refererInfo.referer
referer: refererInfo.topmostLocation,
},
gdprConsent: {
consentString: gdprConsent.consentString,
Expand Down
9 changes: 7 additions & 2 deletions test/spec/modules/glomexBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const BIDDER_REQUEST = {
isAmp: true,
numIframes: 0,
reachedTop: true,
referer: 'https://glomex.com'
topmostLocation: 'https://glomex.com'
},
gdprConsent: {
gdprApplies: true,
Expand Down Expand Up @@ -91,7 +91,12 @@ describe('glomexBidAdapter', function () {
})

it('sends refererInfo', function () {
expect(request.data.refererInfo).to.eql(BIDDER_REQUEST.refererInfo)
const expected = {
...BIDDER_REQUEST.refererInfo,
referer: BIDDER_REQUEST.refererInfo.topmostLocation
}
delete expected.topmostLocation;
expect(request.data.refererInfo).to.eql(expected)
})

it('sends gdprConsent', function () {
Expand Down
3 changes: 1 addition & 2 deletions test/spec/refererDetection_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -499,14 +499,13 @@ describe('ensureProtocol', () => {

describe('parseDomain', () => {
Object.entries({
'example.com': 'example.com',
'www.example.com': 'www.example.com',
'example.com:443': 'example.com:443',
'www.sub.example.com': 'www.sub.example.com',
'example.com/page': 'example.com',
'www.example.com:443/page': 'www.example.com:443',
'http://www.example.com:443/page?query=value': 'www.example.com:443',
'': undefined
'': undefined,
}).forEach(([input, expected]) => {
it(`should extract domain from '${input}' -> '${expected}`, () => {
expect(parseDomain(input)).to.equal(expected);
Expand Down

0 comments on commit 37c735a

Please sign in to comment.