diff options
author | 2022-11-06 18:00:01 -0800 | |
---|---|---|
committer | 2022-11-06 18:00:01 -0800 | |
commit | e5b2e3c6024492a10cb2649477657a168bf9723f (patch) | |
tree | ab1fc4318d462194c859bf6fe40fc43141d46496 | |
parent | 897d7bd56470dc46d9237fb00ec28c039711a00f (diff) | |
download | bun-e5b2e3c6024492a10cb2649477657a168bf9723f.tar.gz bun-e5b2e3c6024492a10cb2649477657a168bf9723f.tar.zst bun-e5b2e3c6024492a10cb2649477657a168bf9723f.zip |
Fixes https://github.com/oven-sh/bun/issues/1451
-rw-r--r-- | src/bun.js/api/server.zig | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/bun.js/api/server.zig b/src/bun.js/api/server.zig index 9a8cd10a6..8a9ae8c54 100644 --- a/src/bun.js/api/server.zig +++ b/src/bun.js/api/server.zig @@ -302,7 +302,13 @@ pub const ServerConfig = struct { } if (arg.getTruthy(global, "port")) |port_| { - args.port = @intCast(u16, @minimum(@maximum(0, port_.toInt32()), std.math.maxInt(u16))); + args.port = @intCast( + u16, + @minimum( + @maximum(0, port_.coerce(i32, global)), + std.math.maxInt(u16), + ), + ); } if (arg.getTruthy(global, "baseURI")) |baseURI| { |