Skip to content

Commit

Permalink
Hotfix for referrer in TrustX Bid Adapter (prebid#4039)
Browse files Browse the repository at this point in the history
* Add trustx adapter and tests for it

* update integration example

* Update trustx adapter

* Post-review fixes of Trustx adapter

* Code improvement for trustx adapter: changed default price type from gross to net

* Update TrustX adapter to support the 1.0 version

* Make requested changes for TrustX adapter

* Updated markdown file for TrustX adapter

* Fix TrustX adapter and spec file

* Update TrustX adapter: r parameter was added to ad request as cache buster

* Add support of gdpr to Trustx Bid Adapter

* Add wtimeout to ad request params for TrustX Bid Adapter

* TrustX Bid Adapter: remove last ampersand in the ad request

* Update TrustX Bid Adapter to support identical uids in parameters

* Update TrustX Bid Adapter to ignore bids that sizes do not match the size of the request

* Update TrustX Bid Adapter to support instream and outstream video

* Added wrapperType and wrapperVersion parameters in ad request for TrustX Bid Adapter

* Update TrustX Bid Adapter to use refererInfo instead depricated function utils.getTopWindowUrl

* HOTFIX for referrer encodind in TrustX Bid Adapter

* Fix test for TrustX Bid Adapter
  • Loading branch information
PWyrembak authored and Alex committed Aug 1, 2019
1 parent ac89563 commit 80cbd44
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion modules/trustxBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const spec = {

if (bidderRequest) {
if (bidderRequest.refererInfo && bidderRequest.refererInfo.referer) {
payload.u = encodeURIComponent(bidderRequest.refererInfo.referer);
payload.u = bidderRequest.refererInfo.referer;
}
if (bidderRequest.timeout) {
payload.wtimeout = bidderRequest.timeout;
Expand Down
10 changes: 5 additions & 5 deletions test/spec/modules/trustxBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('TrustXAdapter', function () {
referer: 'http://example.com'
}
};
const encodedReferer = encodeURIComponent(bidderRequest.refererInfo.referer);
const referrer = bidderRequest.refererInfo.referer;

let bidRequests = [
{
Expand Down Expand Up @@ -95,7 +95,7 @@ describe('TrustXAdapter', function () {
const request = spec.buildRequests([bidRequests[0]], bidderRequest);
expect(request.data).to.be.an('string');
const payload = parseRequest(request.data);
expect(payload).to.have.property('u', encodedReferer);
expect(payload).to.have.property('u', referrer);
expect(payload).to.have.property('pt', 'net');
expect(payload).to.have.property('auids', '43');
expect(payload).to.have.property('sizes', '300x250,300x600');
Expand All @@ -108,7 +108,7 @@ describe('TrustXAdapter', function () {
const request = spec.buildRequests(bidRequests, bidderRequest);
expect(request.data).to.be.an('string');
const payload = parseRequest(request.data);
expect(payload).to.have.property('u', encodedReferer);
expect(payload).to.have.property('u', referrer);
expect(payload).to.have.property('pt', 'net');
expect(payload).to.have.property('auids', '43,43,45');
expect(payload).to.have.property('sizes', '300x250,300x600,728x90');
Expand All @@ -120,7 +120,7 @@ describe('TrustXAdapter', function () {
const request = spec.buildRequests(bidRequests, bidderRequest);
expect(request.data).to.be.an('string');
const payload = parseRequest(request.data);
expect(payload).to.have.property('u', encodedReferer);
expect(payload).to.have.property('u', referrer);
expect(payload).to.have.property('pt', 'gross');
expect(payload).to.have.property('auids', '43,43,45');
expect(payload).to.have.property('sizes', '300x250,300x600,728x90');
Expand All @@ -133,7 +133,7 @@ describe('TrustXAdapter', function () {
const request = spec.buildRequests(bidRequests, bidderRequest);
expect(request.data).to.be.an('string');
const payload = parseRequest(request.data);
expect(payload).to.have.property('u', encodedReferer);
expect(payload).to.have.property('u', referrer);
expect(payload).to.have.property('pt', 'net');
expect(payload).to.have.property('auids', '43,43,45');
expect(payload).to.have.property('sizes', '300x250,300x600,728x90');
Expand Down

0 comments on commit 80cbd44

Please sign in to comment.