Skip to content

Commit

Permalink
buffer: fix typo in hijack algorithm (vulcand#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpollet authored Nov 4, 2022
1 parent fb2728c commit 9260f86
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions buffer/buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,12 +410,12 @@ func (b *bufferWriter) CloseNotify() <-chan bool {
func (b *bufferWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
if hi, ok := b.responseWriter.(http.Hijacker); ok {
conn, rw, err := hi.Hijack()
if err != nil {
if err == nil {
b.hijacked = true
}
return conn, rw, err
}
b.log.Warningf("Upstream ResponseWriter of type %v does not implement http.Hijacker. Returning dummy channel.", reflect.TypeOf(b.responseWriter))
b.log.Warningf("Upstream ResponseWriter of type %v does not implement http.Hijacker.", reflect.TypeOf(b.responseWriter))
return nil, nil, fmt.Errorf("the response writer wrapped in this proxy does not implement http.Hijacker. Its type is: %v", reflect.TypeOf(b.responseWriter))
}

Expand Down

0 comments on commit 9260f86

Please sign in to comment.