diff options
author | 2023-06-17 19:18:02 -0700 | |
---|---|---|
committer | 2023-06-17 19:18:02 -0700 | |
commit | 65f1e426849aa705c0fd7578134b8287f10d0176 (patch) | |
tree | 134aed84da5b4bf2310a2c8dd6a9f411e9572ba4 /src/bun.js/api/server.zig | |
parent | b0e8f596a2a3a5bd3f70d6d03de35c290d34d35c (diff) | |
parent | 065713aeca2ae3013bdf5b3d2f04263459631598 (diff) | |
download | bun-65f1e426849aa705c0fd7578134b8287f10d0176.tar.gz bun-65f1e426849aa705c0fd7578134b8287f10d0176.tar.zst bun-65f1e426849aa705c0fd7578134b8287f10d0176.zip |
Merge branch 'main' into jarred/simplifyjarred/simplify
Diffstat (limited to 'src/bun.js/api/server.zig')
-rw-r--r-- | src/bun.js/api/server.zig | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/bun.js/api/server.zig b/src/bun.js/api/server.zig index 8fd9acde7..37bc601a5 100644 --- a/src/bun.js/api/server.zig +++ b/src/bun.js/api/server.zig @@ -270,6 +270,11 @@ pub const ServerConfig = struct { pub fn inJS(global: *JSC.JSGlobalObject, obj: JSC.JSValue, exception: JSC.C.ExceptionRef) ?SSLConfig { var result = zero; + if (!obj.isObject()) { + JSC.throwInvalidArguments("tls option expects an object", .{}, global, exception); + return null; + } + var any = false; // Required @@ -688,7 +693,7 @@ pub const ServerConfig = struct { } if (arguments.next()) |arg| { - if (arg.isUndefinedOrNull() or !arg.isObject()) { + if (!arg.isObject()) { JSC.throwInvalidArguments("Bun.serve expects an object", .{}, global, exception); return args; } @@ -812,6 +817,9 @@ pub const ServerConfig = struct { } return args; } + } else { + JSC.throwInvalidArguments("Bun.serve expects an object", .{}, global, exception); + return args; } if (args.base_uri.len > 0) { |