summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/labstack/echo/response.go
diff options
context:
space:
mode:
authorDuco van Amstel <helcaraxan@gmail.com>2018-11-18 17:55:05 +0000
committerWim <wim@42.be>2018-11-25 21:21:04 +0100
commit09875fe1603307080f3a4172985c5dca3bd9912d (patch)
treea23220772f6f6597d509ca71b2df3480a77b8076 /vendor/github.com/labstack/echo/response.go
parentf716b8fc0ff90f47b61e218ef34019b38bd70e0d (diff)
downloadmatterbridge-msglm-09875fe1603307080f3a4172985c5dca3bd9912d.tar.gz
matterbridge-msglm-09875fe1603307080f3a4172985c5dca3bd9912d.tar.bz2
matterbridge-msglm-09875fe1603307080f3a4172985c5dca3bd9912d.zip
Update direct dependencies where possible
Diffstat (limited to 'vendor/github.com/labstack/echo/response.go')
-rw-r--r--vendor/github.com/labstack/echo/response.go24
1 files changed, 9 insertions, 15 deletions
diff --git a/vendor/github.com/labstack/echo/response.go b/vendor/github.com/labstack/echo/response.go
index 93204098..6244783b 100644
--- a/vendor/github.com/labstack/echo/response.go
+++ b/vendor/github.com/labstack/echo/response.go
@@ -4,7 +4,6 @@ import (
"bufio"
"net"
"net/http"
- "strconv"
)
type (
@@ -12,14 +11,13 @@ type (
// by an HTTP handler to construct an HTTP response.
// See: https://golang.org/pkg/net/http/#ResponseWriter
Response struct {
- echo *Echo
- contentLength int64
- beforeFuncs []func()
- afterFuncs []func()
- Writer http.ResponseWriter
- Status int
- Size int64
- Committed bool
+ echo *Echo
+ beforeFuncs []func()
+ afterFuncs []func()
+ Writer http.ResponseWriter
+ Status int
+ Size int64
+ Committed bool
}
)
@@ -64,7 +62,6 @@ func (r *Response) WriteHeader(code int) {
r.Status = code
r.Writer.WriteHeader(code)
r.Committed = true
- r.contentLength, _ = strconv.ParseInt(r.Header().Get(HeaderContentLength), 10, 0)
}
// Write writes the data to the connection as part of an HTTP reply.
@@ -74,10 +71,8 @@ func (r *Response) Write(b []byte) (n int, err error) {
}
n, err = r.Writer.Write(b)
r.Size += int64(n)
- if r.Size == r.contentLength {
- for _, fn := range r.afterFuncs {
- fn()
- }
+ for _, fn := range r.afterFuncs {
+ fn()
}
return
}
@@ -106,7 +101,6 @@ func (r *Response) CloseNotify() <-chan bool {
}
func (r *Response) reset(w http.ResponseWriter) {
- r.contentLength = 0
r.beforeFuncs = nil
r.afterFuncs = nil
r.Writer = w