We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b83cd92 + 2f66edc commit bdd456fCopy full SHA for bdd456f
1 file changed
src/browser/webapi/storage/Cookie.zig
@@ -240,12 +240,10 @@ fn validateCookieString(str: []const u8) ValidateCookieError!void {
240
241
// Invalid if (c < 32 AND c != 9) OR c > 126. Tab is the one
242
// sub-space byte we allow through (per browser/WPT behavior).
243
- const below = @intFromBool(chunk < space) & @intFromBool(chunk != tab);
244
- const above = @intFromBool(chunk > tilde);
245
- const reduced: std.meta.Int(.unsigned, size) = @bitCast(below | above);
+ const is_invalid = ((chunk < space) & (chunk != tab)) | (chunk > tilde);
246
247
// Got match.
248
- if (reduced != 0) {
+ if (@reduce(.Or, is_invalid)) {
249
return error.InvalidByteSequence;
250
}
251
0 commit comments