Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message "request completed" when request not completed #308

Closed
someden opened this issue Nov 19, 2023 · 1 comment · Fixed by #309
Closed

Message "request completed" when request not completed #308

someden opened this issue Nov 19, 2023 · 1 comment · Fixed by #309

Comments

@someden
Copy link
Contributor

someden commented Nov 19, 2023

Demo on codesandbox

Request was aborted by express.text middleware because:
Request body length does not match content-length header (I know it's more like hypothetical situation, but anyway)

But there is request completed message from pino-http because res.writableEnded is true.
Maybe it is better to change condition for defaultSuccessfulRequestMessageProvider to something like this:

  return !req.readableAborted && res.writableEnded ? 'request completed' : 'request aborted'
@someden
Copy link
Contributor Author

someden commented Nov 19, 2023

In case there will be something wrong with demo here is screenshot:

Screenshot 2023-11-19 at 20 43 47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant