You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Recovery middleware couldn't recover a panic correctly after something was already written into the ResponseWriter. So I wrote some tests against this issue and fixed it.
It'd be nice if this didn't require buffering the output, but I see what you are going for. Because I feel like many users would not want to buffer the output (and those familiar with the http package are already aware of the fact that the headers are written at the first byte) I think this may make more sense as a separate middleware. Maybe BufferedRecovery?
I can see that some people want to put stuff out directly instead of buffered. So making a separate middleware makes sense.
But I think that more people want a working recovery middleware instead of unbuffered output. So I suggest that the new middleware becomes the new standard in Classic() and replaces the old one.
👍 I'm cool with making it the default in Classic()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Recovery middleware couldn't recover a panic correctly after something was already written into the
ResponseWriter. So I wrote some tests against this issue and fixed it.