Skip to content

Commit

Permalink
Adding the passing of CCPA value to the bid request for video endpoint (
Browse files Browse the repository at this point in the history
  • Loading branch information
camrice authored and mansinahar committed Apr 15, 2020
1 parent db71903 commit d3807b5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions endpoints/openrtb2/video_auction.go
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,10 @@ func mergeData(videoRequest *openrtb_ext.BidRequestVideo, bidRequest *openrtb.Bi
bidRequest.TMax = videoRequest.TMax
}

if videoRequest.Regs != nil {
bidRequest.Regs = videoRequest.Regs
}

return nil
}

Expand Down
6 changes: 6 additions & 0 deletions endpoints/openrtb2/video_auction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,10 @@ func TestMergeOpenRTBToVideoRequest(t *testing.T) {
videoReq.BCat = []string{"test1", "test2"}
videoReq.BAdv = []string{"test3", "test4"}

videoReq.Regs = &openrtb.Regs{
Ext: json.RawMessage(`{"gdpr":1,"us_privacy":"1NYY","existing":"any","consent":"anyConsent"}`),
}

mergeData(videoReq, bidReq)

assert.Equal(t, videoReq.BCat, bidReq.BCat, "BCat is incorrect")
Expand All @@ -641,6 +645,8 @@ func TestMergeOpenRTBToVideoRequest(t *testing.T) {
assert.Equal(t, videoReq.Device.DNT, bidReq.Device.DNT, "Device.DNT is incorrect")

assert.Equal(t, videoReq.Site.Page, bidReq.Site.Page, "Device.Site.Page is incorrect")

assert.Equal(t, videoReq.Regs, bidReq.Regs, "Regs is incorrect")
}

func TestHandleError(t *testing.T) {
Expand Down
8 changes: 8 additions & 0 deletions openrtb_ext/bid_request_video.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ type BidRequestVideo struct {
// Description:
// Block list of advertisers by their domains (e.g., “ford.com”).
BAdv []string `json:"badv,omitempty"`

// Attribute:
// regs
// Type:
// object; optional
// Description:
// Contains the OpenRTB Regs object to be passed to OpenRTB request
Regs *openrtb.Regs `json:"regs,omitempty"`
}

type PodConfig struct {
Expand Down

0 comments on commit d3807b5

Please sign in to comment.