Skip to content

Commit

Permalink
DSA: Use seat nonbid code 300 (#3531)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsardo authored Feb 22, 2024
1 parent 18e9b50 commit 5900d36
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions errortypes/code.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const (
AdServerTargetingWarningCode
BidAdjustmentWarningCode
FloorBidRejectionWarningCode
InvalidBidResponseDSAWarningCode
)

// Coder provides an error or warning code with severity.
Expand Down
6 changes: 3 additions & 3 deletions exchange/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -1247,12 +1247,12 @@ func (e *exchange) makeBid(bids []*entities.PbsOrtbBid, auc *auction, returnCrea
for _, bid := range bids {
if !dsa.Validate(bidRequest, bid) {
RequiredError := openrtb_ext.ExtBidderMessage{
Code: errortypes.BadServerResponseErrorCode,
Message: "bidResponse rejected: DSA object missing when required",
Code: errortypes.InvalidBidResponseDSAWarningCode,
Message: "bid response rejected: DSA object missing when required",
}
bidResponseExt.Warnings[adapter] = append(bidResponseExt.Warnings[adapter], RequiredError)

seatNonBids.addBid(bid, int(ResponseRejectedPrivacy), adapter.String())
seatNonBids.addBid(bid, int(ResponseRejectedGeneral), adapter.String())
continue // Don't add bid to result
}
if e.bidValidationEnforcement.BannerCreativeMaxSize == config.ValidationEnforce && bid.BidType == openrtb_ext.BidTypeBanner {
Expand Down
2 changes: 1 addition & 1 deletion exchange/exchange_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4765,7 +4765,7 @@ func TestMakeBidWithValidation(t *testing.T) {
seatNonBidsMap: map[string][]openrtb_ext.NonBid{
"pubmatic": {
{
StatusCode: 305,
StatusCode: 300,
Ext: openrtb_ext.NonBidExt{
Prebid: openrtb_ext.ExtResponseNonBidPrebid{
Bid: openrtb_ext.NonBidObject{},
Expand Down
4 changes: 2 additions & 2 deletions exchange/non_bid_reason.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ package exchange
type NonBidReason int

const (
NoBidUnknownError NonBidReason = 0 // No Bid - General
NoBidUnknownError NonBidReason = 0 // No Bid - General
ResponseRejectedGeneral NonBidReason = 300
ResponseRejectedCategoryMappingInvalid NonBidReason = 303 // Response Rejected - Category Mapping Invalid
ResponseRejectedPrivacy NonBidReason = 305
ResponseRejectedCreativeSizeNotAllowed NonBidReason = 351 // Response Rejected - Invalid Creative (Size Not Allowed)
ResponseRejectedCreativeNotSecure NonBidReason = 352 // Response Rejected - Invalid Creative (Not Secure)
)
Expand Down

0 comments on commit 5900d36

Please sign in to comment.