Skip to content

Commit

Permalink
Between Adapter: fix for issue#1718
Browse files Browse the repository at this point in the history
prebid#1787
 - removed bidfloor reading from bid ext;
 - since BetweenSSP supports default bidfloor, removed default bidfloor from code
 - removed bidfloor from test samples
  • Loading branch information
Egor Skorokhodov committed May 28, 2021
1 parent 67b88ed commit 2900fb5
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 34 deletions.
18 changes: 1 addition & 17 deletions adapters/between/between.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ type BetweenAdapter struct {

// BetweenSSP requires bidfloor > 0.
// If BidFloor of openrtb_ext.ExtImpBetween is zero, set it to defaultBidFloor value, see addImpProps
const defaultBidfloor = 0.00001

func (a *BetweenAdapter) MakeRequests(request *openrtb.BidRequest, reqInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) {
var errors []error
Expand Down Expand Up @@ -126,19 +125,6 @@ func buildImpBanner(imp *openrtb.Imp) error {
return nil
}

// Add Between required properties to Imp object
func addImpProps(imp *openrtb.Imp, secure *int8, betweenExt *openrtb_ext.ExtImpBetween) {
imp.Secure = secure
if betweenExt.BidFloor <= 0 {
imp.BidFloor = defaultBidfloor
} else {
imp.BidFloor = betweenExt.BidFloor
}
if betweenExt.BidFloorCur != "" {
imp.BidFloorCur = betweenExt.BidFloorCur
}
}

// Adding header fields to request header
func addHeaderIfNonEmpty(headers http.Header, headerName string, headerValue string) {
if len(headerValue) > 0 {
Expand Down Expand Up @@ -167,9 +153,7 @@ func preprocess(request *openrtb.BidRequest) (*openrtb_ext.ExtImpBetween, []erro
errors = append(errors, err)
continue
}

addImpProps(&imp, &secure, betweenExt)

imp.Secure = &secure
if err := buildImpBanner(&imp); err != nil {
errors = append(errors, err)
continue
Expand Down
2 changes: 0 additions & 2 deletions adapters/between/betweentest/exemplary/multi-request.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
"publisher_id": "1"
}
},
"bidfloor": 1e-05,
"secure": 0
},
{
Expand All @@ -92,7 +91,6 @@
"publisher_id": "1"
}
},
"bidfloor": 1e-05,
"secure": 0
}
],
Expand Down
1 change: 0 additions & 1 deletion adapters/between/betweentest/exemplary/secure-detect.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"w": 728,
"h": 90
},
"bidfloor": 1e-05,
"secure": 1,
"ext": {
"bidder": {
Expand Down
10 changes: 2 additions & 8 deletions adapters/between/betweentest/exemplary/simple-site-banner.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
"ext": {
"bidder": {
"host": "127.0.0.1",
"publisher_id": "1",
"bid_floor_cur": "RUB",
"bid_floor": 1000
"publisher_id": "1"
}
}
}
Expand All @@ -48,15 +46,11 @@
"w": 728,
"h": 90
},
"bidfloor": 1000,
"bidfloorcur": "RUB",
"secure": 0,
"ext": {
"bidder": {
"host": "127.0.0.1",
"publisher_id": "1",
"bid_floor_cur": "RUB",
"bid_floor": 1000
"publisher_id": "1"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"w": 728,
"h": 90
},
"bidfloor": 1e-05,
"secure": 0,
"ext": {
"bidder": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"w": 300,
"h": 250
},
"bidfloor": 1e-05,
"secure": 0,
"ext": {
"bidder": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"w": 728,
"h": 90
},
"bidfloor": 1e-05,
"secure": 0,
"ext": {
"bidder": {
Expand Down
1 change: 0 additions & 1 deletion adapters/between/betweentest/supplemental/no-bids.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"w": 728,
"h": 90
},
"bidfloor": 1e-05,
"secure": 0,
"ext": {
"bidder": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"w": 728,
"h": 90
},
"bidfloor": 1e-05,
"secure": 0,
"ext": {
"bidder": {
Expand Down Expand Up @@ -44,7 +43,6 @@
"w": 728,
"h": 90
},
"bidfloor": 1e-05,
"secure": 0,
"ext": {
"bidder": {
Expand Down

0 comments on commit 2900fb5

Please sign in to comment.