aboutsummaryrefslogtreecommitdiffstats
path: root/modules/context/response.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/context/response.go')
-rw-r--r--modules/context/response.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/context/response.go b/modules/context/response.go
index ca52ea137d..8708d77da0 100644
--- a/modules/context/response.go
+++ b/modules/context/response.go
@@ -13,6 +13,7 @@ type ResponseWriter interface {
http.Flusher
Status() int
Before(func(ResponseWriter))
+ Size() int // used by access logger template
}
var _ ResponseWriter = &Response{}
@@ -45,6 +46,10 @@ func (r *Response) Write(bs []byte) (int, error) {
return size, nil
}
+func (r *Response) Size() int {
+ return r.written
+}
+
// WriteHeader write status code
func (r *Response) WriteHeader(statusCode int) {
if !r.beforeExecuted {