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

Orbidder: fix getting the end point url for developoment and integration tests from local storage #5463

Merged
merged 30 commits into from
Aug 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c83a91b
orbidder adapter: add withCredentials:true header to BidRequest and o…
RainerVolk4014 Nov 11, 2019
a66bb59
Merge pull request #1 from siggi-otto/orbidder-with-credentials-header
RainerVolk4014 Nov 14, 2019
ce513dd
add blank in order to trigger build again
RainerVolk4014 Nov 28, 2019
c968344
Merge remote-tracking branch 'upstream/master' into orbidder-with-cre…
RainerVolk4014 Nov 28, 2019
4491370
Merge pull request #2 from siggi-otto/orbidder-with-credentials-header
siggi-otto Nov 28, 2019
c7a7409
remove blank to trigger build ... again
RainerVolk4014 Nov 28, 2019
1d99fc5
Merge pull request #3 from siggi-otto/orbidder-with-credentials-header
siggi-otto Nov 28, 2019
b7a7862
adding extra line to trigger build ... again
RainerVolk4014 Nov 29, 2019
4349ba3
Merge pull request #4 from siggi-otto/orbidder-with-credentials-header
siggi-otto Nov 29, 2019
fa095d1
fetch changes from upstream
hendrikiseke1979 Feb 11, 2020
e0efc34
add prebid version to request
hendrikiseke1979 Feb 11, 2020
939f636
add unit test for version parameter
hendrikiseke1979 Feb 11, 2020
157063e
add version parameter to win requests
hendrikiseke1979 Feb 11, 2020
3481e6e
Merge pull request #5 from siggi-otto/feature/add-prebid-version-to-r…
Feb 13, 2020
1d51c91
fetch changes from upstream
hendrikiseke1979 Feb 13, 2020
a587203
Merge branch 'master' of github.com:siggi-otto/Prebid.js
hendrikiseke1979 Feb 13, 2020
74d22a6
fix comment
hendrikiseke1979 Feb 17, 2020
cc13fed
fetch changes from upstream
hendrikiseke1979 Feb 17, 2020
727377d
trigger rebuild
hendrikiseke1979 Feb 17, 2020
d0f43d9
trigger rebuild
hendrikiseke1979 Feb 18, 2020
4f57c70
fetch changes from upstream
hendrikiseke1979 Feb 20, 2020
1cda428
fetch changes from upstream
Feb 21, 2020
93432ed
fetch changes from upstream
hendrikiseke1979 Feb 24, 2020
bec5f85
Merge branch 'master' of github.com:siggi-otto/Prebid.js
hendrikiseke1979 Feb 24, 2020
9b371db
Merge remote-tracking branch 'upstream/master'
Mar 18, 2020
9746069
Merge branch 'master' of github.com:siggi-otto/Prebid.js
Mar 18, 2020
4c409a7
remove onBidWon callback from adapter
hendrikiseke1979 Jun 23, 2020
5d0a6cb
fetch changes from upstream
hendrikiseke1979 Jul 6, 2020
d902bf2
fix retrieving orbidder endpoint url from local storage
hendrikiseke1979 Jul 7, 2020
735f513
fix unit tests
hendrikiseke1979 Jul 7, 2020
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
15 changes: 9 additions & 6 deletions modules/orbidderBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import {registerBidder} from '../src/adapters/bidderFactory.js';
import { getStorageManager } from '../src/storageManager.js';

const storage = getStorageManager();
const storageManager = getStorageManager();

export const spec = {
code: 'orbidder',
orbidderHost: (() => {
let ret = 'https://orbidder.otto.de';
hostname: 'https://orbidder.otto.de',

getHostname() {
let ret = this.hostname;
try {
ret = storage.getDataFromLocalStorage('ov_orbidder_host') || ret;
ret = storageManager.getDataFromLocalStorage('ov_orbidder_host') || ret;
} catch (e) {
}
return ret;
})(),
},

isBidRequestValid(bid) {
return !!(bid.sizes && bid.bidId && bid.params &&
Expand All @@ -23,14 +25,15 @@ export const spec = {
},

buildRequests(validBidRequests, bidderRequest) {
const hostname = this.getHostname();
return validBidRequests.map((bidRequest) => {
let referer = '';
if (bidderRequest && bidderRequest.refererInfo) {
referer = bidderRequest.refererInfo.referer || '';
}

const ret = {
url: `${spec.orbidderHost}/bid`,
url: `${hostname}/bid`,
method: 'POST',
options: { withCredentials: true },
data: {
Expand Down
4 changes: 1 addition & 3 deletions test/spec/modules/orbidderBidAdapter_spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import {expect} from 'chai';
import {spec} from 'modules/orbidderBidAdapter.js';
import {newBidder} from 'src/adapters/bidderFactory.js';
import openxAdapter from '../../../modules/openxAnalyticsAdapter.js';
import {detectReferer} from 'src/refererDetection.js';

describe('orbidderBidAdapter', () => {
const adapter = newBidder(spec);
Expand Down Expand Up @@ -93,7 +91,7 @@ describe('orbidderBidAdapter', () => {
it('sends bid request to endpoint via https using post', () => {
expect(request.method).to.equal('POST');
expect(request.url.indexOf('https://')).to.equal(0);
expect(request.url).to.equal(`${spec.orbidderHost}/bid`);
expect(request.url).to.equal(`${spec.hostname}/bid`);
});

it('contains prebid version parameter', () => {
Expand Down