Skip to content

Commit

Permalink
Unmarshal update
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexBVolcy committed May 16, 2023
1 parent 27a1610 commit de6a020
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions usersync/cookie.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,17 +247,20 @@ func (cookie *Cookie) UnmarshalJSON(b []byte) error {

cookie.optOut = cookieContract.OptOut
cookie.birthday = cookieContract.Birthday
cookie.uids = make(map[string]uidWithExpiry)

if !cookie.optOut {
if cookieContract.UIDs != nil {
cookie.uids = cookieContract.UIDs
}
// Audience Network / Facebook Handling
if id, ok := cookie.uids[string(openrtb_ext.BidderAudienceNetwork)]; ok && id.UID == "0" {
delete(cookie.uids, string(openrtb_ext.BidderAudienceNetwork))
}
cookie.uids = cookieContract.UIDs
}

if cookie.uids == nil {
cookie.uids = make(map[string]uidWithExpiry)
}

// Audience Network / Facebook Handling
if id, ok := cookie.uids[string(openrtb_ext.BidderAudienceNetwork)]; ok && id.UID == "0" {
delete(cookie.uids, string(openrtb_ext.BidderAudienceNetwork))
}

return nil
}

Expand Down

0 comments on commit de6a020

Please sign in to comment.