Skip to content
This repository was archived by the owner on Dec 22, 2022. It is now read-only.

Commit 5d55f49

Browse files
AadeshpAadesh Patel
and
Aadesh Patel
authored
treat 204 from FAN as a no bids response (prebid#1233)
Co-authored-by: Aadesh Patel <[email protected]>
1 parent 667dc0d commit 5d55f49

File tree

2 files changed

+97
-0
lines changed

2 files changed

+97
-0
lines changed
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
{
2+
"mockBidRequest": {
3+
"id": "test-req-id",
4+
"imp": [
5+
{
6+
"id": "test-imp-id",
7+
"native": {
8+
"request": "{\"ver\":\"1.1\",\"context\":1,\"contextsubtype\":11,\"plcmttype\":4,\"plcmtcnt\":1,\"assets\":[{\"id\":1,\"required\":1,\"title\":{\"len\":500}},{\"id\":2,\"required\":1,\"img\":{\"type\":3,\"wmin\":1,\"hmin\":1}},{\"id\":3,\"required\":0,\"data\":{\"type\":1,\"len\":200}},{\"id\":4,\"required\":0,\"data\":{\"type\":2,\"len\":15000}},{\"id\":5,\"required\":0,\"data\":{\"type\":6,\"len\":40}},{\"id\":6,\"required\":0,\"data\":{\"type\":500}}]}",
9+
"ver": "1.1"
10+
},
11+
"ext": {
12+
"bidder": {
13+
"publisherid": "123",
14+
"placementid": "456"
15+
}
16+
}
17+
}
18+
],
19+
"site": {
20+
"domain": "prebid.org",
21+
"page": "prebid.org"
22+
},
23+
"device": {
24+
"ip": "152.193.6.74"
25+
},
26+
"user": {
27+
"id": "db089de9-a62e-4861-a881-0ff15e052516",
28+
"buyeruid": "v4_bidder_token"
29+
},
30+
"tmax": 500
31+
},
32+
"httpcalls": [
33+
{
34+
"expectedRequest": {
35+
"uri": "https://an.facebook.com/placementbid.ortb",
36+
"headers": {
37+
"Accept": [
38+
"application/json"
39+
],
40+
"Content-Type": [
41+
"application/json;charset=utf-8"
42+
],
43+
"X-Fb-Pool-Routing-Token": [
44+
"v4_bidder_token"
45+
]
46+
},
47+
"body": {
48+
"id": "test-req-id",
49+
"imp": [
50+
{
51+
"id": "test-imp-id",
52+
"native": {
53+
"w": -1,
54+
"h": -1
55+
},
56+
"tagid": "123_456"
57+
}
58+
],
59+
"ext": {
60+
"appnexus": {
61+
"hb_source": 5
62+
},
63+
"prebid": {}
64+
},
65+
"site": {
66+
"domain": "prebid.org",
67+
"page": "prebid.org",
68+
"publisher": {
69+
"id": "123"
70+
}
71+
},
72+
"device": {
73+
"ip": "152.193.6.74"
74+
},
75+
"user": {
76+
"id": "db089de9-a62e-4861-a881-0ff15e052516",
77+
"buyeruid": "v4_bidder_token"
78+
},
79+
"tmax": 500,
80+
"ext": {
81+
"authentication_id": "b2f9edfd707106adb6b692520081ad7e2a345444af1a895310228297a1b6247e",
82+
"platformid": "test-platform-id"
83+
}
84+
}
85+
},
86+
"mockResponse": {
87+
"status": 204
88+
}
89+
}
90+
]
91+
}

adapters/audienceNetwork/facebook.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,12 @@ func modifyImpCustom(json []byte, imp *openrtb.Imp) ([]byte, error) {
333333
}
334334

335335
func (this *FacebookAdapter) MakeBids(request *openrtb.BidRequest, adapterRequest *adapters.RequestData, response *adapters.ResponseData) (*adapters.BidderResponse, []error) {
336+
/* No bid response */
337+
if response.StatusCode == http.StatusNoContent {
338+
return nil, nil
339+
}
340+
341+
/* Any other http status codes outside of 200 and 204 should be treated as errors */
336342
if response.StatusCode != http.StatusOK {
337343
msg := response.Headers.Get("x-fb-an-errors")
338344
return nil, []error{&errortypes.BadInput{

0 commit comments

Comments
 (0)