1
0
Fork 0
forked from forgejo/forgejo

Fix regression: access log template, gitea manager cli command (#24838)

Close #24836

![image](95b025d2-f25f-4246-a08a-fe44ecb787a9)

![image](c3afe1fa-2a23-420d-a016-3b67dcd04cd5)
This commit is contained in:
wxiaoguang 2023-05-22 09:38:38 +08:00 committed by GitHub
parent 2d3ebe889e
commit ec2a01d1e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 36 additions and 34 deletions

View file

@ -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 {