1
0
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:
Gerasimos (Makis) Maropoulos
2020-07-24 22:36:46 +03:00
parent a4efb222cc
commit 2f8b29cb3d
6 changed files with 18 additions and 82 deletions

View File

@@ -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
}