Skip to content

Commit

Permalink
RTB house Bid Adapter: fix encoding bug for bid response for native a…
Browse files Browse the repository at this point in the history
…ds (prebid#9850)

* RTB hose Bid Adapter: encode URI corecctly using encodeURI instead of encodeURIComponent
  • Loading branch information
kmrnpu authored and jorgeluisrocha committed May 18, 2023
1 parent a188d3a commit dd1367f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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

0 comments on commit dd1367f

Please sign in to comment.