Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ORTB 2.6: Push wrapper into set legacy from GPP functions #4001

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions exchange/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ func (rs *requestSplitter) cleanOpenRTBRequests(ctx context.Context,

// GPP downgrade: always downgrade unless we can confirm GPP is supported
if shouldSetLegacyPrivacy(rs.bidderInfo, string(coreBidder)) {
setLegacyGDPRFromGPP(reqWrapperCopy.BidRequest, gpp)
setLegacyUSPFromGPP(reqWrapperCopy.BidRequest, gpp)
setLegacyGDPRFromGPP(reqWrapperCopy, gpp)
setLegacyUSPFromGPP(reqWrapperCopy, gpp)
}

// remove imps with stored responses so they aren't sent to the bidder
Expand Down Expand Up @@ -1015,7 +1015,7 @@ func applyFPD(fpd map[openrtb_ext.BidderName]*firstpartydata.ResolvedFirstPartyD
}
}

func setLegacyGDPRFromGPP(r *openrtb2.BidRequest, gpp gpplib.GppContainer) {
func setLegacyGDPRFromGPP(r *openrtb_ext.RequestWrapper, gpp gpplib.GppContainer) {
if r.Regs != nil && r.Regs.GDPR == nil {
if r.Regs.GPPSID != nil {
// Set to 0 unless SID exists
Expand Down Expand Up @@ -1044,13 +1044,12 @@ func setLegacyGDPRFromGPP(r *openrtb2.BidRequest, gpp gpplib.GppContainer) {
}
}
}

}
func setLegacyUSPFromGPP(r *openrtb2.BidRequest, gpp gpplib.GppContainer) {

func setLegacyUSPFromGPP(r *openrtb_ext.RequestWrapper, gpp gpplib.GppContainer) {
if r.Regs == nil {
return
}

if len(r.Regs.USPrivacy) > 0 || r.Regs.GPPSID == nil {
return
}
Expand All @@ -1065,7 +1064,6 @@ func setLegacyUSPFromGPP(r *openrtb2.BidRequest, gpp gpplib.GppContainer) {
}
}
}

}

func WrapJSONInData(data []byte) []byte {
Expand Down
Loading