Skip to content

Commit

Permalink
fix(node): only send 500 if no headers sent yet (#857)
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Glastra <timo@animo.id>
  • Loading branch information
TimoGlastra committed Jun 15, 2022
1 parent 3022bd2 commit 4be8f82
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/node/src/transport/HttpInboundTransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ export class HttpInboundTransport implements InboundTransport {
}
} catch (error) {
config.logger.error(`Error processing inbound message: ${error.message}`, error)
res.status(500).send('Error processing message')

if (!res.headersSent) {
res.status(500).send('Error processing message')
}
} finally {
transportService.removeSession(session)
}
Expand Down

0 comments on commit 4be8f82

Please sign in to comment.