This repository has been archived on 2023-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
dex/vendor/github.com/gorilla/handlers/handlers_go18.go
Stephan Renatus 076cd77469
run 'go get -u; make revendor'
Signed-off-by: Stephan Renatus <srenatus@chef.io>
2019-07-31 08:09:38 +02:00

30 lines
616 B
Go

// +build go1.8
package handlers
import (
"fmt"
"net/http"
)
type loggingResponseWriter interface {
commonLoggingResponseWriter
http.Pusher
}
func (l *responseLogger) Push(target string, opts *http.PushOptions) error {
p, ok := l.w.(http.Pusher)
if !ok {
return fmt.Errorf("responseLogger does not implement http.Pusher")
}
return p.Push(target, opts)
}
func (c *compressResponseWriter) Push(target string, opts *http.PushOptions) error {
p, ok := c.ResponseWriter.(http.Pusher)
if !ok {
return fmt.Errorf("compressResponseWriter does not implement http.Pusher")
}
return p.Push(target, opts)
}