Skip to content

Commit

Permalink
localStrageを読み込むかどうかはdefault: falseとなるように変更 (prebid#9146)
Browse files Browse the repository at this point in the history
Co-authored-by: mediaconsortium-develop <mediaconsortium-develop@bi.garage.co.jp>
  • Loading branch information
yki-t and mediaconsortium-develop authored Oct 27, 2022
1 parent fc67eb0 commit 11fd3d3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions modules/dgkeywordRtdProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function getDgKeywordsAndSet(reqBidsConfigObj, callback, moduleConfig, us
} else {
logMessage('[dgkeyword sub module] dgkeyword targets:', setKeywordTargetBidders);
logMessage('[dgkeyword sub module] get targets from profile api start.');
ajax(getProfileApiUrl(moduleConfig?.params?.url, moduleConfig?.params?.disableReadFpid), {
ajax(getProfileApiUrl(moduleConfig?.params?.url, moduleConfig?.params?.enableReadFpid), {
success: function(response) {
const res = JSON.parse(response);
if (!isFinish) {
Expand Down Expand Up @@ -96,9 +96,9 @@ export function getDgKeywordsAndSet(reqBidsConfigObj, callback, moduleConfig, us
}
}

export function getProfileApiUrl(customeUrl, disableReadFpid) {
export function getProfileApiUrl(customeUrl, enableReadFpid) {
const URL = 'https://mediaconsortium.profiles.tagger.opecloud.com/api/v1';
const fpid = (disableReadFpid) ? '' : readFpidFromLocalStrage();
const fpid = (enableReadFpid) ? readFpidFromLocalStrage() : '';
let url = customeUrl || URL;
url = url + '?url=' + encodeURIComponent(window.location.href) + ((fpid) ? `&fpid=${fpid}` : '');
return url;
Expand Down
6 changes: 3 additions & 3 deletions test/spec/modules/dgkeywordRtdProvider_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,10 +383,11 @@ describe('Digital Garage Keyword Module', function () {
}
let moduleConfig = cloneDeep(DEF_CONFIG);
window.localStorage.setItem('ope_fpid', uuid);
moduleConfig.params.enableReadFpid = true;
dgRtd.getDgKeywordsAndSet(
pbjs,
() => {
const url = dgRtd.getProfileApiUrl(null);
const url = dgRtd.getProfileApiUrl(null, moduleConfig.params.enableReadFpid);
expect(url.indexOf(uuid) > 0).to.equal(true);
expect(url).to.equal(server.requests[0].url);
done();
Expand All @@ -410,11 +411,10 @@ describe('Digital Garage Keyword Module', function () {
}
let moduleConfig = cloneDeep(DEF_CONFIG);
window.localStorage.setItem('ope_fpid', uuid);
moduleConfig.params.disableReadFpid = true;
dgRtd.getDgKeywordsAndSet(
pbjs,
() => {
const url = dgRtd.getProfileApiUrl(null, moduleConfig.params.disableReadFpid);
const url = dgRtd.getProfileApiUrl(null);
expect(url.indexOf(uuid) > 0).to.equal(false);
expect(url).to.equal(server.requests[0].url);
done();
Expand Down

0 comments on commit 11fd3d3

Please sign in to comment.