mirror of
https://github.com/gin-gonic/gin.git
synced 2026-01-07 23:03:11 +08:00
Merge 83be301525b83ec05f8f26edec19e66d0ce9981c into 3f95933c3d8ab010c1454b35b6dd8b534948f928
This commit is contained in:
commit
f6a7d14700
@ -22,6 +22,7 @@ type (
|
||||
http.Hijacker
|
||||
http.Flusher
|
||||
http.CloseNotifier
|
||||
io.ReaderFrom
|
||||
|
||||
// Returns the HTTP response status code of the current request.
|
||||
Status() int
|
||||
@ -114,3 +115,13 @@ func (w *responseWriter) CloseNotify() <-chan bool {
|
||||
func (w *responseWriter) Flush() {
|
||||
w.ResponseWriter.(http.Flusher).Flush()
|
||||
}
|
||||
|
||||
// Implements the io.ReaderFrom interface
|
||||
func (w *responseWriter) ReadFrom(r io.Reader) (n int64, err error) {
|
||||
if w.size < 0 {
|
||||
w.size = 0
|
||||
}
|
||||
n, err = w.ResponseWriter.(io.ReaderFrom).ReadFrom(r)
|
||||
w.size += int(n)
|
||||
return
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user