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

RTB house Bid Adapter: fix encoding bug for bid response of native ads #9850

Merged
merged 1 commit into from
Apr 25, 2023
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
6 changes: 3 additions & 3 deletions modules/rtbhouseBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ function interpretNativeBid(serverBid) {
function interpretNativeAd(adm) {
const native = JSON.parse(adm).native;
const result = {
clickUrl: encodeURIComponent(native.link.url),
clickUrl: encodeURI(native.link.url),
impressionTrackers: native.imptrackers
};
native.assets.forEach(asset => {
Expand All @@ -489,14 +489,14 @@ function interpretNativeAd(adm) {
break;
case OPENRTB.NATIVE.ASSET_ID.IMAGE:
result.image = {
url: encodeURIComponent(asset.img.url),
url: encodeURI(asset.img.url),
width: asset.img.w,
height: asset.img.h
};
break;
case OPENRTB.NATIVE.ASSET_ID.ICON:
result.icon = {
url: encodeURIComponent(asset.img.url),
url: encodeURI(asset.img.url),
width: asset.img.w,
height: asset.img.h
};
Expand Down
4 changes: 2 additions & 2 deletions test/spec/modules/rtbhouseBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -631,10 +631,10 @@ describe('RTBHouseAdapter', () => {
expect(bids[0].meta.advertiserDomains).to.deep.equal(['rtbhouse.com']);
expect(bids[0].native).to.deep.equal({
title: 'Title text',
clickUrl: encodeURIComponent('https://example.com'),
clickUrl: encodeURI('https://example.com'),
impressionTrackers: ['https://example.com/imptracker'],
image: {
url: encodeURIComponent('https://example.com/image.jpg'),
url: encodeURI('https://example.com/image.jpg'),
width: 150,
height: 50
},
Expand Down