Skip to content

Commit 024cd46

Browse files
committed
fixes
1 parent 85f8de7 commit 024cd46

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

packages/server-utils/src/integrations/tracing-channel/fastify/instrumentation.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,13 @@ function setNotFoundHandlerPatched(this: any, hooks: any, handler?: any): void {
300300
});
301301
}
302302

303+
// Fastify allows `setNotFoundHandler(opts)` without a handler, falling back to its built-in 404
304+
// handler. Forward the (already-wrapped) hooks unchanged so that fallback still applies.
305+
if (handler == null) {
306+
setNotFoundHandlerOriginal.call(this, hooks);
307+
return;
308+
}
309+
303310
setNotFoundHandlerOriginal.call(
304311
this,
305312
hooks,

0 commit comments

Comments
 (0)