From 701d1ab638b23c24877fc41824add66232446676 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Thu, 2 Feb 2017 09:32:00 -0500 Subject: Updating server dependancies (#5249) --- vendor/github.com/NYTimes/gziphandler/gzip.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'vendor/github.com/NYTimes/gziphandler/gzip.go') diff --git a/vendor/github.com/NYTimes/gziphandler/gzip.go b/vendor/github.com/NYTimes/gziphandler/gzip.go index dad0eb747..fbc99396d 100644 --- a/vendor/github.com/NYTimes/gziphandler/gzip.go +++ b/vendor/github.com/NYTimes/gziphandler/gzip.go @@ -1,8 +1,10 @@ package gziphandler import ( + "bufio" "compress/gzip" "fmt" + "net" "net/http" "strconv" "strings" @@ -131,6 +133,18 @@ func (w *GzipResponseWriter) Flush() { } } +// Hijack implements http.Hijacker. If the underlying ResponseWriter is a +// Hijacker, its Hijack method is returned. Otherwise an error is returned. +func (w *GzipResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) { + if hj, ok := w.ResponseWriter.(http.Hijacker); ok { + return hj.Hijack() + } + return nil, nil, fmt.Errorf("http.Hijacker interface is not supported") +} + +// verify Hijacker interface implementation +var _ http.Hijacker = &GzipResponseWriter{} + // MustNewGzipLevelHandler behaves just like NewGzipLevelHandler except that in // an error case it panics rather than returning an error. func MustNewGzipLevelHandler(level int) func(http.Handler) http.Handler { -- cgit v1.2.3-1-g7c22