TUN-7253: Adopt http.ResponseWriter for connection.ResponseWriter

This commit is contained in:
Devin Carr
2023-03-07 10:41:15 -08:00
parent 27f88ae209
commit bf3136debb
4 changed files with 31 additions and 9 deletions

View File

@@ -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