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

bug: recovery middleware has a bug #269

Open
pjebs opened this issue Oct 19, 2022 · 0 comments
Open

bug: recovery middleware has a bug #269

pjebs opened this issue Oct 19, 2022 · 0 comments
Labels

Comments

@pjebs
Copy link
Contributor

pjebs commented Oct 19, 2022

There is a comment here regarding https://github.com/urfave/negroni/blob/master/recovery.go#L160:

maruel/panicparse#81 (comment)

As a matter of fact, the code you pointed to in recovery.go is functionally wrong. The only way it could be done is if it were buffering a temporary http.ResponseWriter, and only flushing it when the handler returned. The current code will fail at line 161 as WriteHeader() will ignore the status if data was already written (that's how HTTP works) and the stack data will just be appended to whatever was already streamed to the user. That's bad.

@jszwedko jszwedko added the bug label Oct 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants