Skip to content

Commit

Permalink
CCPA string fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvialiu404 committed Jun 14, 2023
1 parent 1c9c17c commit ee8418c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ccpa_parsed_consent.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ type CcpaParsedConsent struct {

func IsValidCCPAString(ccpaString string) (bool, error) {
if len(ccpaString) != 4 {
return false, errors.Wrap(nil, "invalid uspv consent string length")
return false, errors.New("invalid uspv consent string length")
}

if ccpaString[0]-'0' != CCPAVersion {
return false, errors.Wrap(nil, "invalid uspv consent string version")
return false, errors.New("invalid uspv consent string version")
}

for i := 1; i < 4; i++ {
if ccpaString[i] != CCPAYes && ccpaString[i] != CCPANo && ccpaString[i] != CCPANotApplicable {
return false, errors.Wrap(nil, "invalid uspv consent string")
return false, errors.New("invalid uspv consent string")
}
}

Expand Down

0 comments on commit ee8418c

Please sign in to comment.