http: Add UnderlyingResponseWriter function

This commit is contained in:
Sasha Koshka 2024-12-13 21:18:29 -05:00
parent 8142e520f5
commit 5124e6f8f7

View File

@ -77,6 +77,13 @@ func (this WrappedHeader) Set (name, value string) string {
return "" return ""
} }
// UnderlyingResponseWriter returns the underlying http.ResponseWriter of a
// WrappedResponseWriter. This is a separate function because it should not be
// directly accessible to templates.
func UnderlyingResponseWriter (writer WrappedResponseWriter) http.ResponseWriter {
return writer.responseWriter
}
var _ http.ResponseWriter = new(HTTPResponseRecorder) var _ http.ResponseWriter = new(HTTPResponseRecorder)
// HTTPResponseRecorder is an http.ResponseWriter that can buffer a response to // HTTPResponseRecorder is an http.ResponseWriter that can buffer a response to