diff --git a/adapters/eplanning/eplanning.go b/adapters/eplanning/eplanning.go index bd1c37d41c3..a3f9be385b9 100644 --- a/adapters/eplanning/eplanning.go +++ b/adapters/eplanning/eplanning.go @@ -196,17 +196,9 @@ func (adapter *EPlanningAdapter) MakeRequests(request *openrtb2.BidRequest, reqI query.Set("vv", vastVersionDefault) } if request.Source != nil && request.Source.Ext != nil { - var randNum int - if adapter.testing { - randNum = 1 - } else { - randNum = rand.Intn(1000) - } - if randNum == 1 { - if openRtbSchain := unmarshalSupplyChain(request); openRtbSchain != nil { - if schainValue := makeSupplyChain(*openRtbSchain); schainValue != "" { - query.Set("sch", schainValue) - } + if openRtbSchain := unmarshalSupplyChain(request); openRtbSchain != nil && len(openRtbSchain.Nodes) > 2 { + if schainValue := makeSupplyChain(*openRtbSchain); schainValue != "" { + query.Set("sch", schainValue) } } } diff --git a/adapters/eplanning/eplanningtest/supplemental/bid-with-2-nodes-schain.json b/adapters/eplanning/eplanningtest/supplemental/bid-with-2-nodes-schain.json new file mode 100644 index 00000000000..08773aeae70 --- /dev/null +++ b/adapters/eplanning/eplanningtest/supplemental/bid-with-2-nodes-schain.json @@ -0,0 +1,100 @@ +{ + "mockBidRequest": { + "id": "test-request-id", + "source": { + "ext": { + "schain": { + "ver": "1.0", + "complete": 1, + "nodes": [ + { + "asi": "exchange1.com", + "sid": "1234", + "hp": 1, + "ext": "text" + }, + { + "asi": "exchange2.com", + "sid": "abcd", + "hp": 1, + "ext": 1 + } + ] + } + } + }, + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + }, + { + "w": 300, + "h": 600 + } + ] + }, + "ext": { + "bidder": { + "ci": "12345" + } + } + } + ] + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "http://rtb.e-planning.net/pbs/1/12345/1/FILE/ROS?e=300x250%3A300x250&ncb=1&ur=FILE", + "body": {}, + "impIDs":["test-imp-id"] + }, + "mockResponse": { + "status": 200, + "body": { + "sI": { "k": "12345" }, + "sec": "ROS", + "sp": [ + { + "k": "300x250", + "a": [{ + "i": "123456789abcdef", + "pr": "0.5", + "adm": "