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

Bug fixes in rhythmone bidder adapter #913

Merged
merged 1 commit into from
Jan 17, 2017
Merged
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
11 changes: 4 additions & 7 deletions src/adapters/rhythmone.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ module.exports = function(bidManager, global, loader){
callback(200, "success", response.responseText);
else
callback(-1, "http error "+response.status, response.responseText);
}, false, {method:"GET"});
}, false, {method:"GET", withCredentials: true});
}
else{
loader(url, function(responseText, response){
if(response.status === 200)
callback(200, "success", response.responseText);
else
callback(-1, "http error "+response.status, response.responseText);
}, postData, {method:"POST", contentType: "application/json"});
}, postData, {method:"POST", contentType: "application/json", withCredentials: true});
}
}

Expand Down Expand Up @@ -115,6 +115,7 @@ module.exports = function(bidManager, global, loader){
function noBids(params){
for(var i=0; i<params.bids.length; i++){
if(params.bids[i].success !== 1){
logToConsole("registering nobid for slot "+params.bids[i].placementCode);
var bid = bidfactory.createBid(CONSTANTS.STATUS.NO_BID);
bid.bidderCode = bidderCode;
track(debug, 'hb', 'bidResponse', 0);
Expand Down Expand Up @@ -290,8 +291,6 @@ module.exports = function(bidManager, global, loader){

logToConsole(txt);

var bidCount = 0;

if(code === -1)
track(debug, 'hb', 'rmpReplyFail', msg);
else{
Expand All @@ -316,7 +315,6 @@ module.exports = function(bidManager, global, loader){

track(debug, 'hb', 'bidResponse', 1);
bidManager.addBidResponse(placementCode, pbResponse);
bidCount++;
};

track(debug, 'hb', 'rmpReplySuccess');
Expand All @@ -331,8 +329,7 @@ module.exports = function(bidManager, global, loader){
}

// if no bids are successful, inform prebid
if(bidCount === 0)
noBids(params);
noBids(params);

// when all bids are complete, log a report
track(debug, 'hb', 'bidsComplete');
Expand Down