Skip to content

Commit 69fb0eb

Browse files
camriceSyntaxNode
authored andcommitted
Adding the passing of CCPA value to the bid request for video endpoint (#1143)
1 parent 9067c60 commit 69fb0eb

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

endpoints/openrtb2/video_auction.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,10 @@ func mergeData(videoRequest *openrtb_ext.BidRequestVideo, bidRequest *openrtb.Bi
500500
bidRequest.TMax = videoRequest.TMax
501501
}
502502

503+
if videoRequest.Regs != nil {
504+
bidRequest.Regs = videoRequest.Regs
505+
}
506+
503507
return nil
504508
}
505509

endpoints/openrtb2/video_auction_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,10 @@ func TestMergeOpenRTBToVideoRequest(t *testing.T) {
629629
videoReq.BCat = []string{"test1", "test2"}
630630
videoReq.BAdv = []string{"test3", "test4"}
631631

632+
videoReq.Regs = &openrtb.Regs{
633+
Ext: json.RawMessage(`{"gdpr":1,"us_privacy":"1NYY","existing":"any","consent":"anyConsent"}`),
634+
}
635+
632636
mergeData(videoReq, bidReq)
633637

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

643647
assert.Equal(t, videoReq.Site.Page, bidReq.Site.Page, "Device.Site.Page is incorrect")
648+
649+
assert.Equal(t, videoReq.Regs, bidReq.Regs, "Regs is incorrect")
644650
}
645651

646652
func TestHandleError(t *testing.T) {

openrtb_ext/bid_request_video.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,14 @@ type BidRequestVideo struct {
128128
// Description:
129129
// Block list of advertisers by their domains (e.g., “ford.com”).
130130
BAdv []string `json:"badv,omitempty"`
131+
132+
// Attribute:
133+
// regs
134+
// Type:
135+
// object; optional
136+
// Description:
137+
// Contains the OpenRTB Regs object to be passed to OpenRTB request
138+
Regs *openrtb.Regs `json:"regs,omitempty"`
131139
}
132140

133141
type PodConfig struct {

0 commit comments

Comments
 (0)