Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix intercepting headers in middlewares (#1271)
* 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 Signed-off-by: Thibault Jamet <tjamet@users.noreply.github.com>
- Loading branch information