mirror of
https://github.com/kataras/iris.git
synced 2025-02-02 15:30:36 +01:00
net/http testing library doesnt supprots CloseNotify, so don't panic on context.StreamWriter
This commit is contained in:
parent
d060a73559
commit
7df9b2b437
|
@ -231,7 +231,11 @@ func (w *responseWriter) Flush() {
|
|||
// is a problem, use HTTP/2 or only use CloseNotify on methods
|
||||
// such as POST.
|
||||
func (w *responseWriter) CloseNotify() <-chan bool {
|
||||
return w.ResponseWriter.(http.CloseNotifier).CloseNotify()
|
||||
if notifier, supportsCloseNotify := w.ResponseWriter.(http.CloseNotifier); supportsCloseNotify {
|
||||
return notifier.CloseNotify()
|
||||
}
|
||||
ch := make(chan bool, 1)
|
||||
return ch
|
||||
}
|
||||
|
||||
// clone returns a clone of this response writer
|
||||
|
|
Loading…
Reference in New Issue
Block a user