mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 10:27:06 +00:00
examples: use ctx.ResponseWriter().Naive().(http.Pusher) instead
Former-commit-id: 7802f4eadf2b1c0a0d2a42ed5ebac3e5c77f88cc
This commit is contained in:
@@ -184,10 +184,6 @@ type CompressResponseWriter struct {
|
||||
CompressWriter
|
||||
ResponseWriter
|
||||
|
||||
http.Pusher
|
||||
http.Hijacker
|
||||
http.CloseNotifier
|
||||
|
||||
Disabled bool
|
||||
Encoding string
|
||||
Level int
|
||||
@@ -234,26 +230,6 @@ func AcquireCompressResponseWriter(w ResponseWriter, r *http.Request, level int)
|
||||
v.CompressWriter = encWriter
|
||||
|
||||
AddCompressHeaders(w.Header(), encoding)
|
||||
|
||||
pusher, ok := w.(http.Pusher)
|
||||
if !ok {
|
||||
pusher = nil // make sure interface value is nil.
|
||||
}
|
||||
|
||||
hijacker, ok := w.(http.Hijacker)
|
||||
if !ok {
|
||||
hijacker = nil
|
||||
}
|
||||
|
||||
closeNotifier, ok := w.(http.CloseNotifier)
|
||||
if !ok {
|
||||
closeNotifier = nil
|
||||
}
|
||||
|
||||
v.Pusher = pusher
|
||||
v.Hijacker = hijacker
|
||||
v.CloseNotifier = closeNotifier
|
||||
|
||||
return v, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user