Skip to content

Commit

Permalink
review.
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez authored and traefiker committed Sep 20, 2019
1 parent 19f7dd2 commit 4a9b78f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions middlewares/errorpages/error_pages.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ type codeCatcherWithCloseNotify struct {

// CloseNotify returns a channel that receives at most a
// single value (true) when the client connection has gone away.
func (r *codeCatcherWithCloseNotify) CloseNotify() <-chan bool {
return r.responseWriter.(http.CloseNotifier).CloseNotify()
func (cc *codeCatcherWithCloseNotify) CloseNotify() <-chan bool {
return cc.responseWriter.(http.CloseNotifier).CloseNotify()
}

func newCodeCatcher(rw http.ResponseWriter, httpCodeRanges types.HTTPCodeRanges) responseInterceptor {
Expand Down Expand Up @@ -218,12 +218,10 @@ func (cc *codeCatcher) Write(buf []byte) (int, error) {
}

func (cc *codeCatcher) WriteHeader(code int) {
if cc.headersSent {
return
}
if cc.caughtFilteredCode {
if cc.headersSent || cc.caughtFilteredCode {
return
}

cc.code = code
for _, block := range cc.httpCodeRanges {
if cc.code >= block[0] && cc.code <= block[1] {
Expand Down

0 comments on commit 4a9b78f

Please sign in to comment.