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