From 48e6658eca43b908ec0b18ab4eb30452bdcb16ae Mon Sep 17 00:00:00 2001 From: Ruben Cid Date: Fri, 3 Aug 2018 12:33:46 +0200 Subject: [PATCH] Add access to pusher --- context/context.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/context/context.go b/context/context.go index 8b32062c..394a4e31 100644 --- a/context/context.go +++ b/context/context.go @@ -244,3 +244,11 @@ func (r *Response) CloseNotify() <-chan bool { } return nil } + +// Pusher http.Pusher +func (r *Response) Pusher() (pusher http.Pusher) { + if pusher, ok := r.ResponseWriter.(http.Pusher); ok { + return pusher + } + return nil +} \ No newline at end of file