Skip to content

Commit

Permalink
Always allow host cookies when the host vendor id is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
bsardo committed Jan 21, 2021
1 parent 1f050df commit f013bd3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gdpr/gdpr.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func NewPermissions(ctx context.Context, cfg config.GDPR, vendorIDs map[openrtb_
}

if cfg.HostVendorID == 0 {
return &DisallowHostCookies{
return &AllowHostCookies{
permissionsImpl: permissionsImpl,
}
}
Expand Down
2 changes: 1 addition & 1 deletion gdpr/gdpr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestNewPermissions(t *testing.T) {
{
gdprEnabled: true,
hostVendorID: 0,
wantType: &DisallowHostCookies{},
wantType: &AllowHostCookies{},
},
{
gdprEnabled: true,
Expand Down
8 changes: 4 additions & 4 deletions gdpr/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,14 @@ func (p *permissionsImpl) parseVendor(ctx context.Context, vendorID uint16, cons
return
}

// DisallowHostCookies represents a GDPR permissions policy with host cookie syncing disallowed
type DisallowHostCookies struct {
// AllowHostCookies represents a GDPR permissions policy with host cookie syncing disallowed
type AllowHostCookies struct {
*permissionsImpl
}

// HostCookiesAllowed always returns false
func (p *DisallowHostCookies) HostCookiesAllowed(ctx context.Context, consent string) (bool, error) {
return false, nil
func (p *AllowHostCookies) HostCookiesAllowed(ctx context.Context, consent string) (bool, error) {
return true, nil
}

// Exporting to allow for easy test setups
Expand Down

0 comments on commit f013bd3

Please sign in to comment.