mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Remove duplicate "ResponseWriter.Status" method (#33346)
This commit is contained in:
@@ -85,7 +85,7 @@ func (lr *accessLogRecorder) record(start time.Time, respWriter ResponseWriter,
|
||||
},
|
||||
RequestID: &requestID,
|
||||
}
|
||||
tmplData.ResponseWriter.Status = respWriter.Status()
|
||||
tmplData.ResponseWriter.Status = respWriter.WrittenStatus()
|
||||
tmplData.ResponseWriter.Size = respWriter.WrittenSize()
|
||||
err = lr.logTemplate.Execute(buf, tmplData)
|
||||
if err != nil {
|
||||
|
@@ -48,10 +48,6 @@ func (t testAccessLoggerResponseWriterMock) WrittenStatus() int {
|
||||
return http.StatusOK
|
||||
}
|
||||
|
||||
func (t testAccessLoggerResponseWriterMock) Status() int {
|
||||
return t.WrittenStatus()
|
||||
}
|
||||
|
||||
func (t testAccessLoggerResponseWriterMock) WrittenSize() int {
|
||||
return 123123
|
||||
}
|
||||
|
@@ -11,12 +11,11 @@ import (
|
||||
|
||||
// ResponseWriter represents a response writer for HTTP
|
||||
type ResponseWriter interface {
|
||||
http.ResponseWriter
|
||||
http.Flusher
|
||||
web_types.ResponseStatusProvider
|
||||
http.ResponseWriter // provides Header/Write/WriteHeader
|
||||
http.Flusher // provides Flush
|
||||
web_types.ResponseStatusProvider // provides WrittenStatus
|
||||
|
||||
Before(fn func(ResponseWriter))
|
||||
Status() int
|
||||
WrittenSize() int
|
||||
}
|
||||
|
||||
@@ -75,12 +74,6 @@ func (r *Response) Flush() {
|
||||
}
|
||||
}
|
||||
|
||||
// Status returns status code written
|
||||
// TODO: use WrittenStatus instead
|
||||
func (r *Response) Status() int {
|
||||
return r.status
|
||||
}
|
||||
|
||||
// WrittenStatus returned status code written
|
||||
func (r *Response) WrittenStatus() int {
|
||||
return r.status
|
||||
|
Reference in New Issue
Block a user