Skip to content

Commit

Permalink
LKQD: Use refererInfo.referer as fallback pageurl (prebid#4210)
Browse files Browse the repository at this point in the history
* Refactored URL query parameter passthrough for additional values, changed SSP endpoint to v.lkqd.net, and updated associated unit tests

* Use refererInfo.referer as fallback pageurl

* Removed logs and testing values
  • Loading branch information
mrcrawfo authored and harpere committed Sep 20, 2019
1 parent def7138 commit 1e03b4b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 3 additions & 1 deletion modules/lkqdBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function isBidRequestValid(bidRequest) {
return false;
}

function buildRequests(validBidRequests) {
function buildRequests(validBidRequests, bidderRequest) {
let bidRequests = [];

for (let i = 0; i < validBidRequests.length; i++) {
Expand Down Expand Up @@ -138,6 +138,8 @@ function buildRequests(validBidRequests) {
}
if (bidRequest.params.hasOwnProperty('pageurl') && bidRequest.params.pageurl != null) {
sspData.pageurl = bidRequest.params.pageurl;
} else if (bidderRequest && bidderRequest.refererInfo) {
sspData.pageurl = encodeURIComponent(bidderRequest.refererInfo.referer);
}
if (bidRequest.params.hasOwnProperty('contentId') && bidRequest.params.contentId != null) {
sspData.contentid = bidRequest.params.contentId;
Expand Down
4 changes: 1 addition & 3 deletions test/spec/modules/lkqdBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('LKQD Bid Adapter Test', function () {
});
});

describe('buildRequests', function () {
describe('buildRequests', () => {
const ENDPOINT = 'https://v.lkqd.net/ad';
let bidRequests = [
{
Expand Down Expand Up @@ -101,14 +101,12 @@ describe('LKQD Bid Adapter Test', function () {
expect(requests.length).to.equal(2);
const r1 = requests[0].data;
expect(r1).to.not.have.property('dnt');
expect(r1).to.not.have.property('pageurl');
expect(r1).to.not.have.property('contentid');
expect(r1).to.not.have.property('contenttitle');
expect(r1).to.not.have.property('contentlength');
expect(r1).to.not.have.property('contenturl');
const r2 = requests[1].data;
expect(r2).to.not.have.property('dnt');
expect(r2).to.not.have.property('pageurl');
expect(r2).to.not.have.property('contentid');
expect(r2).to.not.have.property('contenttitle');
expect(r2).to.not.have.property('contentlength');
Expand Down

0 comments on commit 1e03b4b

Please sign in to comment.