File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 1
1
package echo
2
2
3
3
import (
4
+ "bufio"
4
5
"log"
6
+ "net"
5
7
"net/http"
6
8
7
9
"github.com/labstack/gommon/color"
@@ -37,6 +39,21 @@ func (r *Response) Write(b []byte) (n int, err error) {
37
39
return n , err
38
40
}
39
41
42
+ // Flush wraps response writer's Flush function.
43
+ func (r * Response ) Flush () {
44
+ r .Writer .(http.Flusher ).Flush ()
45
+ }
46
+
47
+ // Hijack wraps response writer's Hijack function.
48
+ func (r * Response ) Hijack () (net.Conn , * bufio.ReadWriter , error ) {
49
+ return r .Writer .(http.Hijacker ).Hijack ()
50
+ }
51
+
52
+ // CloseNotify wraps response writer's CloseNotify function.
53
+ func (r * Response ) CloseNotify () <- chan bool {
54
+ return r .Writer .(http.CloseNotifier ).CloseNotify ()
55
+ }
56
+
40
57
func (r * Response ) Status () int {
41
58
return r .status
42
59
}
@@ -47,5 +64,6 @@ func (r *Response) Size() int64 {
47
64
48
65
func (r * Response ) reset (w http.ResponseWriter ) {
49
66
r .Writer = w
67
+ r .status = http .StatusOK
50
68
r .committed = false
51
69
}
You can’t perform that action at this time.
0 commit comments