feat: vendor gitea 1.16.2
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
package context
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"net"
|
||||
"net/http"
|
||||
|
||||
web_types "code.gitea.io/gitea/modules/web/types"
|
||||
@@ -67,6 +69,15 @@ func (r *Response) WriteHeader(statusCode int) {
|
||||
}
|
||||
}
|
||||
|
||||
// Hijack implements http.Hijacker, delegating to the underlying ResponseWriter.
|
||||
// This is needed for WebSocket upgrades through reverse proxies.
|
||||
func (r *Response) Hijack() (net.Conn, *bufio.ReadWriter, error) {
|
||||
if hj, ok := r.ResponseWriter.(http.Hijacker); ok {
|
||||
return hj.Hijack()
|
||||
}
|
||||
return nil, nil, http.ErrNotSupported
|
||||
}
|
||||
|
||||
// Flush flushes cached data
|
||||
func (r *Response) Flush() {
|
||||
if f, ok := r.ResponseWriter.(http.Flusher); ok {
|
||||
|
||||
Reference in New Issue
Block a user