aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Alex Lam S.L <alexlamsl@gmail.com> 2023-01-15 13:21:34 +0200
committerGravatar GitHub <noreply@github.com> 2023-01-15 03:21:34 -0800
commit9eb4a4ff3a8a4b0babf3d7e1bb2188c7ef1bbac1 (patch)
treeb375a1a8b1fdc8382fe6b05a597800755d511dcc /src
parent7932a558703d7f7f2c655383f25d2432bb2e6263 (diff)
downloadbun-9eb4a4ff3a8a4b0babf3d7e1bb2188c7ef1bbac1.tar.gz
bun-9eb4a4ff3a8a4b0babf3d7e1bb2188c7ef1bbac1.tar.zst
bun-9eb4a4ff3a8a4b0babf3d7e1bb2188c7ef1bbac1.zip
[Response] reject HTTP status code correctly (#1800)
Diffstat (limited to 'src')
-rw-r--r--src/bun.js/webcore/body.zig3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/bun.js/webcore/body.zig b/src/bun.js/webcore/body.zig
index fe8643062..05616c7df 100644
--- a/src/bun.js/webcore/body.zig
+++ b/src/bun.js/webcore/body.zig
@@ -171,7 +171,7 @@ pub const Body = struct {
if (response_init.fastGet(ctx, .status)) |status_value| {
const number = status_value.to(i32);
- if (number > 0)
+ if (100 <= number and number < 1000)
result.status_code = @truncate(u16, @intCast(u32, number));
}
@@ -183,7 +183,6 @@ pub const Body = struct {
}
}
- if (result.headers == null and result.status_code < 200) return null;
return result;
}
};