proxy: recognize client's cancellation

fix issue #1589

Signed-off-by: Tw <tw19881113@gmail.com>
This commit is contained in:
Tw
2017-04-19 22:56:51 +08:00
parent 705cb98865
commit 0146bb4e49
7 changed files with 87 additions and 41 deletions

View File

@@ -2,7 +2,6 @@ package httpserver
import (
"bufio"
"errors"
"net"
"net/http"
"time"
@@ -103,7 +102,7 @@ func (r *ResponseRecorder) Push(target string, opts *http.PushOptions) error {
return pusher.Push(target, opts)
}
return errors.New("push is unavailable (probably chained http.ResponseWriter does not implement http.Pusher)")
return NonPusherError{Underlying: r.ResponseWriter}
}
// Interface guards