Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change craftBidAdapter request URL #6096

Merged
merged 2 commits into from
Dec 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions modules/craftBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import includes from 'core-js-pure/features/array/includes.js';
import { getStorageManager } from '../src/storageManager.js';

const BIDDER_CODE = 'craft';
const URL = 'https://gacraft.jp/prebid-v3';
const URL_BASE = 'https://gacraft.jp/prebid-v3';
const TTL = 360;
const storage = getStorageManager();

Expand Down Expand Up @@ -143,10 +143,11 @@ function formatRequest(payload, bidderRequest) {
withCredentials: false
};
}

const payloadString = JSON.stringify(payload);
return {
method: 'POST',
url: URL,
url: `${URL_BASE}/${payload.tags[0].sitekey}`,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our servers supports both new and old URL.

data: payloadString,
bidderRequest,
options
Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/craftBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe('craftAdapter', function () {
it('sends bid request to ENDPOINT via POST', function () {
let request = spec.buildRequests(bidRequests, bidderRequest);
expect(request.method).to.equal('POST');
expect(request.url).to.equal('https://gacraft.jp/prebid-v3');
expect(request.url).to.equal('https://gacraft.jp/prebid-v3/craft-prebid-example');
let data = JSON.parse(request.data);
expect(data.tags).to.deep.equals([{
sitekey: 'craft-prebid-example',
Expand Down