Update timeouthandler.go

master
yangjinheng 2 years ago committed by Kevin Wan
parent 7086fb6dda
commit 96998ae570

@ -125,6 +125,14 @@ type timeoutWriter struct {
var _ http.Pusher = (*timeoutWriter)(nil) var _ http.Pusher = (*timeoutWriter)(nil)
func (tw *timeoutWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
if hijacked, ok := tw.w.(http.Hijacker); ok {
return hijacked.Hijack()
}
return nil, nil, errors.New("server doesn't support hijacking")
}
// Header returns the underline temporary http.Header. // Header returns the underline temporary http.Header.
func (tw *timeoutWriter) Header() http.Header { return tw.h } func (tw *timeoutWriter) Header() http.Header { return tw.h }

Loading…
Cancel
Save