Skip to content

Commit

Permalink
Merge pull request #2 from adform/SSP-933
Browse files Browse the repository at this point in the history
SSP-933
  • Loading branch information
evercoinx committed May 18, 2016
2 parents 4cd106e + 5ea2b17 commit 9d56cb3
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/adapters/adform.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function AdformAdapter() {
request.unshift('//' + adxDomain + '/adx/?rp=4');
}

request.push(formRequestUrl(bid.params));
request = request.concat( formRequestUrl(bid.params) );
}

if (noDomain) {
Expand All @@ -41,20 +41,33 @@ function AdformAdapter() {

function formRequestUrl(reqData) {
var key;
var url = [];
var url = [],
params = [];

var validProps = [
'mid', 'inv', 'pdom', 'mname', 'mkw', 'mkv', 'cat', 'bcat', 'bcatrt', 'adv', 'advt', 'cntr', 'cntrt', 'maxp',
'minp', 'sminp', 'w', 'h', 'pb', 'pos', 'cturl', 'iturl', 'cttype', 'hidedomain', 'cdims', 'test'
];

var validPropsWithURIEncode = [
'url'
];

for (var i = 0, l = validProps.length; i < l; i++) {
key = validProps[i];
if (reqData.hasOwnProperty(key))
if (reqData.hasOwnProperty(key)) {
url.push(key, '=', reqData[key], '&');
}
}
params.push( encode64(url.join('')) );

return encode64(url.join(''));
for (var i = 0, l = validPropsWithURIEncode.length; i < l; i++) {
key = validPropsWithURIEncode[i];
if (reqData.hasOwnProperty(key)) {
params.push( [key, '=', encodeURIComponent( reqData[key] )].join('') );
}
}
return params;
}

function handleCallback(bids) {
Expand Down

0 comments on commit 9d56cb3

Please sign in to comment.