File tree 1 file changed +14
-0
lines changed 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,12 @@ type CountingResponseWriter struct {
18
18
RequestBody * bytes.Buffer
19
19
}
20
20
21
+ var (
22
+ _ http.ResponseWriter = (* CountingResponseWriter )(nil )
23
+ _ http.Flusher = (* CountingResponseWriter )(nil )
24
+ _ http.Hijacker = (* CountingResponseWriter )(nil )
25
+ )
26
+
21
27
func (crw * CountingResponseWriter ) Header () http.Header {
22
28
return crw .ResponseWriter .Header ()
23
29
}
@@ -45,6 +51,14 @@ func (crw *CountingResponseWriter) WriteHeader(statusCode int) {
45
51
}
46
52
}
47
53
54
+ func (crw * CountingResponseWriter ) Flush () {
55
+ flusher , ok := crw .ResponseWriter .(http.Flusher )
56
+ if ! ok {
57
+ return
58
+ }
59
+ flusher .Flush ()
60
+ }
61
+
48
62
func (crw * CountingResponseWriter ) Hijack () (net.Conn , * bufio.ReadWriter , error ) {
49
63
hijacker , ok := crw .ResponseWriter .(http.Hijacker )
50
64
if ! ok {
You can’t perform that action at this time.
0 commit comments