Fix intercepting headers in middlewares (#1271)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
* Fix intercepting headers in middlewares As explained in the TestInterceptedHeader test, in case a middleware filters out the headers, this middleware can be done inefficient in case one following handler is using c.String or other methods writing to the response body directly. This commit fixes the issue by using c.Writer when writing the Status as done in other c.Header, c.SetCookie and other response writers. The bug has been originally discovered using https://github.com/gin-contrib/gzip where a failing test has been added here: https://github.com/tjamet/gzip/blob/header/gzip_test.go#L71 Signed-off-by: Thibault Jamet <tjamet@users.noreply.github.com> * Skip Intercepted Header test for go <1.6
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Trailers
- Signed-off-by: Thibault Jamet <tjamet@users.noreply.github.com>
Diff stats
1 file+50 added−0 removed
- other:+50 added−0 removed