From 5124e6f8f7d51631f147a0c18f273f879930f047 Mon Sep 17 00:00:00 2001 From: "sashakoshka@tebibyte.media" Date: Fri, 13 Dec 2024 21:18:29 -0500 Subject: [PATCH] http: Add UnderlyingResponseWriter function --- http/http.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/http/http.go b/http/http.go index f3438f6..01b7bf3 100644 --- a/http/http.go +++ b/http/http.go @@ -77,6 +77,13 @@ func (this WrappedHeader) Set (name, value string) string { 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) // HTTPResponseRecorder is an http.ResponseWriter that can buffer a response to