Skip to content

Commit 1c42a07

Browse files
committed
fix: throw 404 only when writableEnded is not set
1 parent 1a80bd9 commit 1c42a07

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/app.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ export function createApp (options: AppOptions = {}): App {
3535
}
3636
}
3737

38-
throw createError(404, 'Not Found')
38+
if (!res.writableEnded) {
39+
throw createError(404, 'Not Found')
40+
}
3941
}
4042

4143
const handle: Handle = function (req: IncomingMessage, res: ServerResponse) {

0 commit comments

Comments
 (0)