mirror of
https://github.com/rancher/steve.git
synced 2025-09-28 16:16:25 +00:00
Ensure redirector supports Hijacking if possible
This commit is contained in:
@@ -18,6 +18,9 @@ func RedirectRewrite(next http.Handler) http.Handler {
|
|||||||
ResponseWriter: rw,
|
ResponseWriter: rw,
|
||||||
prefix: prefix,
|
prefix: prefix,
|
||||||
}
|
}
|
||||||
|
if h, ok := rw.(http.Hijacker); ok {
|
||||||
|
r.Hijacker = h
|
||||||
|
}
|
||||||
next.ServeHTTP(r, req)
|
next.ServeHTTP(r, req)
|
||||||
r.Close()
|
r.Close()
|
||||||
})
|
})
|
||||||
@@ -25,6 +28,7 @@ func RedirectRewrite(next http.Handler) http.Handler {
|
|||||||
|
|
||||||
type redirector struct {
|
type redirector struct {
|
||||||
http.ResponseWriter
|
http.ResponseWriter
|
||||||
|
http.Hijacker
|
||||||
prefix string
|
prefix string
|
||||||
from, to string
|
from, to string
|
||||||
tempBuffer *bytes.Buffer
|
tempBuffer *bytes.Buffer
|
||||||
|
Reference in New Issue
Block a user