Update timeouthandler.go

This commit is contained in:
yangjinheng 2023-02-27 14:06:10 +08:00 committed by Kevin Wan
parent 7086fb6dda
commit 96998ae570

View File

@ -125,6 +125,14 @@ type timeoutWriter struct {
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.
func (tw *timeoutWriter) Header() http.Header { return tw.h }