|
@@ -1,6 +1,11 @@
|
|
|
package logger
|
|
|
|
|
|
-import "net/http"
|
|
|
+import (
|
|
|
+ "bufio"
|
|
|
+ "errors"
|
|
|
+ "net"
|
|
|
+ "net/http"
|
|
|
+)
|
|
|
|
|
|
type ResponseWriter struct {
|
|
|
http.ResponseWriter
|
|
@@ -9,6 +14,13 @@ type ResponseWriter struct {
|
|
|
Status int
|
|
|
}
|
|
|
|
|
|
+func (w *ResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
|
|
|
+ if h, ok := w.ResponseWriter.(http.Hijacker); ok {
|
|
|
+ return h.Hijack()
|
|
|
+ }
|
|
|
+ return nil, nil, errors.New("hijack not supported")
|
|
|
+}
|
|
|
+
|
|
|
func (w *ResponseWriter) Write(b []byte) (int, error) {
|
|
|
if RollBarEnabled && !RollBarSkipStatusCodes.contain(w.Status) {
|
|
|
w.Content = append(w.Content, b...)
|