Skip to content

bug: recovery middleware has a bug #269

@pjebs

Description

@pjebs

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions