Skip to content
代码片段 群组 项目
未验证 提交 ca71f461 编辑于 作者: Mikhail Mazurskiy's avatar Mikhail Mazurskiy
浏览文件

Add unwrapping to sendDataResponseWriter

上级 5b6d1527
无相关合并请求
......@@ -44,7 +44,7 @@ func SendData(h http.Handler, injecters ...Injecter) http.Handler {
req: r,
injecters: injecters,
}
defer s.Flush()
defer s.flush()
h.ServeHTTP(&s, r)
}))
}
......@@ -101,7 +101,11 @@ func (s *sendDataResponseWriter) tryInject() bool {
return false
}
func (s *sendDataResponseWriter) Flush() {
func (s *sendDataResponseWriter) flush() {
s.WriteHeader(http.StatusOK)
http.NewResponseController(s.rw).Flush()
}
// Unwrap lets http.ResponseController get the underlying http.ResponseWriter.
func (s *sendDataResponseWriter) Unwrap() http.ResponseWriter {
return s.rw
}
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册