Skip to content

Commit

Permalink
Add Gambid parameter "reqformat" to HTTP request (prebid#2917)
Browse files Browse the repository at this point in the history
This parameter, while not yet required, is the preferred method of
calling the Gambid server, and so as a best practice should be sent from
the bid adapter as well.
  • Loading branch information
arikkfir authored and florevallatmrf committed Sep 6, 2018
1 parent 9853598 commit 759dc1a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/gambidBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const spec = {
return validBidRequests.map(bidRequest => {
const { adUnitCode, auctionId, mediaTypes, params, sizes, transactionId } = bidRequest;
const baseEndpoint = params[ 'rtbEndpoint' ] || 'https://rtb.gambid.io';
const rtbEndpoint = `${baseEndpoint}/r/${params.supplyPartnerId}/bidr?rformat=open_rtb&bidder=prebid` + (params.query ? '&' + params.query : '');
const rtbEndpoint = `${baseEndpoint}/r/${params.supplyPartnerId}/bidr?rformat=open_rtb&reqformat=rtb_json&bidder=prebid` + (params.query ? '&' + params.query : '');
const rtbBidRequest = {
'id': auctionId,
'site': {
Expand Down
4 changes: 2 additions & 2 deletions test/spec/modules/gambidBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ describe('GambidAdapter', () => {

response = spec.buildRequests([ bidRequest ])[ 0 ];
expect(response.method).to.equal('POST');
expect(response.url).to.match(new RegExp(`^https://rtb\\.gambid\\.io/r/${supplyPartnerId}/bidr\\?rformat=open_rtb&bidder=prebid$`, 'g'));
expect(response.url).to.match(new RegExp(`^https://rtb\\.gambid\\.io/r/${supplyPartnerId}/bidr\\?rformat=open_rtb&reqformat=rtb_json&bidder=prebid$`, 'g'));
expect(response.data.id).to.equal(bidRequest.auctionId);

const bidRequestWithEndpoint = utils.deepClone(bidRequest);
bidRequestWithEndpoint.params.rtbEndpoint = 'https://rtb2.gambid.io/a12';
response = spec.buildRequests([ bidRequestWithEndpoint ])[ 0 ];
expect(response.url).to.match(new RegExp(`^https://rtb2\\.gambid\\.io/a12/r/${supplyPartnerId}/bidr\\?rformat=open_rtb&bidder=prebid$`, 'g'));
expect(response.url).to.match(new RegExp(`^https://rtb2\\.gambid\\.io/a12/r/${supplyPartnerId}/bidr\\?rformat=open_rtb&reqformat=rtb_json&bidder=prebid$`, 'g'));
});

it('builds request correctly', () => {
Expand Down

0 comments on commit 759dc1a

Please sign in to comment.