diff options
-rw-r--r-- | src/bun.js/api/server.zig | 4 | ||||
-rw-r--r-- | test/bun.js/serve.test.ts | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/bun.js/api/server.zig b/src/bun.js/api/server.zig index d99d7c9be..485b9c1eb 100644 --- a/src/bun.js/api/server.zig +++ b/src/bun.js/api/server.zig @@ -4142,11 +4142,11 @@ pub fn NewServer(comptime ssl_enabled_: bool, comptime debug_mode_: bool) type { if (exception.* != null) return js.JSValueMakeUndefined(ctx); // only reload those two - if (new_config.onRequest != .zero) { + if (this.config.onRequest != new_config.onRequest) { this.config.onRequest.unprotect(); this.config.onRequest = new_config.onRequest; } - if (new_config.onError != .zero) { + if (this.config.onError != new_config.onError) { this.config.onError.unprotect(); this.config.onError = new_config.onError; } diff --git a/test/bun.js/serve.test.ts b/test/bun.js/serve.test.ts index 002a21973..d6e7b7322 100644 --- a/test/bun.js/serve.test.ts +++ b/test/bun.js/serve.test.ts @@ -262,7 +262,7 @@ describe("streaming", () => { ); }); - // TODO: this test fails because we write status/headers at start of stream + // Also verifies error handler reset in `.reload()` due to test above it("text from JS throws on start with no error handler", async () => { await runTest( { |