Skip to content

Commit

Permalink
change request method (prebid#7360)
Browse files Browse the repository at this point in the history
Co-authored-by: atkachov <atkachov@admixer.ua>
  • Loading branch information
AdmixerTech and altkachov authored Aug 30, 2021
1 parent c978365 commit 695e480
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions modules/admixerBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,10 @@ export const spec = {
Object.keys(bid).forEach(key => imp[key] = bid[key]);
payload.imps.push(imp);
});
const payloadString = JSON.stringify(payload);
return {
method: 'GET',
method: 'POST',
url: endpointUrl || ENDPOINT_URL,
data: `data=${payloadString}`,
data: payload,
};
},
/**
Expand Down
6 changes: 3 additions & 3 deletions test/spec/modules/admixerBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ describe('AdmixerAdapter', function () {

it('should add referrer and imp to be equal bidRequest', function () {
const request = spec.buildRequests(validRequest, bidderRequest);
const payload = JSON.parse(request.data.substr(5));
const payload = request.data;
expect(payload.referrer).to.not.be.undefined;
expect(payload.imps[0]).to.deep.equal(validRequest[0]);
});

it('sends bid request to ENDPOINT via GET', function () {
const request = spec.buildRequests(validRequest, bidderRequest);
expect(request.url).to.equal(ENDPOINT_URL);
expect(request.method).to.equal('GET');
expect(request.method).to.equal('POST');
});

it('sends bid request to CUSTOM_ENDPOINT via GET', function () {
Expand All @@ -85,7 +85,7 @@ describe('AdmixerAdapter', function () {
});
const request = config.runWithBidder(BIDDER_CODE, () => spec.buildRequests(validRequest, bidderRequest));
expect(request.url).to.equal(ENDPOINT_URL_CUSTOM);
expect(request.method).to.equal('GET');
expect(request.method).to.equal('POST');
});
});

Expand Down

0 comments on commit 695e480

Please sign in to comment.