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 11package echo
22
33import (
4+ "bufio"
45 "log"
6+ "net"
57 "net/http"
68
79 "github.com/labstack/gommon/color"
@@ -37,6 +39,21 @@ func (r *Response) Write(b []byte) (n int, err error) {
3739 return n , err
3840}
3941
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+
4057func (r * Response ) Status () int {
4158 return r .status
4259}
@@ -47,5 +64,6 @@ func (r *Response) Size() int64 {
4764
4865func (r * Response ) reset (w http.ResponseWriter ) {
4966 r .Writer = w
67+ r .status = http .StatusOK
5068 r .committed = false
5169}
You can’t perform that action at this time.
0 commit comments