mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-27 19:59:58 +00:00
TUN-7253: Adopt http.ResponseWriter for connection.ResponseWriter
This commit is contained in:
@@ -197,6 +197,7 @@ type http2RespWriter struct {
|
||||
flusher http.Flusher
|
||||
shouldFlush bool
|
||||
statusWritten bool
|
||||
respHeaders http.Header
|
||||
log *zerolog.Logger
|
||||
}
|
||||
|
||||
@@ -276,6 +277,14 @@ func (rp *http2RespWriter) WriteRespHeaders(status int, header http.Header) erro
|
||||
return nil
|
||||
}
|
||||
|
||||
func (rp *http2RespWriter) Header() http.Header {
|
||||
return rp.respHeaders
|
||||
}
|
||||
|
||||
func (rp *http2RespWriter) WriteHeader(status int) {
|
||||
rp.WriteRespHeaders(status, rp.respHeaders)
|
||||
}
|
||||
|
||||
func (rp *http2RespWriter) WriteErrorResponse() bool {
|
||||
if rp.statusWritten {
|
||||
return false
|
||||
|
Reference in New Issue
Block a user