diff --git a/interceptor/middleware/loggingresponsewriter.go b/interceptor/middleware/loggingresponsewriter.go index 9c893f1c1..996199279 100644 --- a/interceptor/middleware/loggingresponsewriter.go +++ b/interceptor/middleware/loggingresponsewriter.go @@ -1,6 +1,9 @@ package middleware import ( + "bufio" + "errors" + "net" "net/http" ) @@ -46,3 +49,12 @@ func (lrw *loggingResponseWriter) WriteHeader(statusCode int) { lrw.statusCode = statusCode } + +// implements http.hijacker +func (lrw *loggingResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) { + if hj, ok := lrw.downstreamResponseWriter.(http.Hijacker); ok { + return hj.Hijack() + } + + return nil, nil, errors.New("http.Hijacker not implemented") +}