Skip to content

Commit

Permalink
Fix: Adhese handle 200 response with empty array body (prebid#3323)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsardo authored Nov 28, 2023
1 parent d82c997 commit b7d474f
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
3 changes: 3 additions & 0 deletions adapters/adhese/adhese.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ func (a *AdheseAdapter) MakeBids(internalRequest *openrtb2.BidRequest, externalR
return nil, []error{err, WrapServerError(fmt.Sprintf("Response %v could not be parsed as generic Adhese bid.", string(response.Body)))}
}

if len(adheseBidResponseArray) == 0 {
return nil, nil
}
var adheseBid = adheseBidResponseArray[0]

if adheseBid.Origin == "JERLICIA" {
Expand Down
54 changes: 54 additions & 0 deletions adapters/adhese/adhesetest/supplemental/res-no_bids_200.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"mockBidRequest": {
"id": "test-req",
"user": {
"ext": {
"consent" : "dummy"
}
},
"imp": [
{
"id": "test-req",
"banner": {
"format": [
{
"w": 300,
"h": 250
}
]
},
"ext": {
"bidder": {
"account": "demo",
"location": "_adhese_prebid_demo_",
"format": "leaderboard",
"targets":
{
"ci": ["gent", "brussels"],
"ag": ["55"],
"tl": ["all"]
}
}
}
}
],
"site": {
"id": "test",
"publisher": {
"id": "123"
}
}
},
"httpCalls": [
{
"expectedRequest": {
"uri": "https://ads-demo.adhese.com/json/sl_adhese_prebid_demo_-leaderboard/ag55/cigent;brussels/tlall/xtdummy"
},
"mockResponse": {
"status": 200,
"body": []
}
}
],
"expectedBidResponses": []
}

0 comments on commit b7d474f

Please sign in to comment.