mirror of
https://gitee.com/gitea/gitea.git
synced 2024-12-03 20:28:04 +08:00
9fe4437bda
* Use vendored go-swagger * vendor go-swagger * revert un wanteed change * remove un-needed GO111MODULE * Update Makefile Co-Authored-By: techknowlogick <matti@mdranta.net>
30 lines
616 B
Go
Vendored
30 lines
616 B
Go
Vendored
// +build go1.8
|
|
|
|
package handlers
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
)
|
|
|
|
type loggingResponseWriter interface {
|
|
commonLoggingResponseWriter
|
|
http.Pusher
|
|
}
|
|
|
|
func (l *responseLogger) Push(target string, opts *http.PushOptions) error {
|
|
p, ok := l.w.(http.Pusher)
|
|
if !ok {
|
|
return fmt.Errorf("responseLogger does not implement http.Pusher")
|
|
}
|
|
return p.Push(target, opts)
|
|
}
|
|
|
|
func (c *compressResponseWriter) Push(target string, opts *http.PushOptions) error {
|
|
p, ok := c.ResponseWriter.(http.Pusher)
|
|
if !ok {
|
|
return fmt.Errorf("compressResponseWriter does not implement http.Pusher")
|
|
}
|
|
return p.Push(target, opts)
|
|
}
|