Skip to content

Commit

Permalink
fix(proto): Fix visitor data base64url decoding (LuanRT#576)
Browse files Browse the repository at this point in the history
  • Loading branch information
absidue committed Jan 12, 2024
1 parent 59f4cfb commit 3980f97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/proto/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function encodeVisitorData(id: string, timestamp: number): string {
}

export function decodeVisitorData(visitor_data: string): VisitorData.Type {
const data = VisitorData.decodeBinary(base64ToU8(decodeURIComponent(visitor_data)));
const data = VisitorData.decodeBinary(base64ToU8(decodeURIComponent(visitor_data).replace(/-/g, '+').replace(/_/g, '/')));
return data;
}

Expand Down

0 comments on commit 3980f97

Please sign in to comment.