From abd045493aef695668824518a161b18cc22846e2 Mon Sep 17 00:00:00 2001 From: Hein Date: Tue, 2 Dec 2025 17:34:18 +0200 Subject: [PATCH] mux UnderlyingRequest --- pkg/common/adapters/router/mux.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkg/common/adapters/router/mux.go b/pkg/common/adapters/router/mux.go index 96f0b97..b707eef 100644 --- a/pkg/common/adapters/router/mux.go +++ b/pkg/common/adapters/router/mux.go @@ -137,6 +137,12 @@ func (h *HTTPRequest) AllHeaders() map[string]string { return headers } +// UnderlyingRequest returns the underlying *http.Request +// This is useful when you need to pass the request to other handlers +func (h *HTTPRequest) UnderlyingRequest() *http.Request { + return h.req +} + // HTTPResponseWriter adapts our ResponseWriter interface to standard http.ResponseWriter type HTTPResponseWriter struct { resp http.ResponseWriter @@ -166,6 +172,12 @@ func (h *HTTPResponseWriter) WriteJSON(data interface{}) error { return json.NewEncoder(h.resp).Encode(data) } +// UnderlyingResponseWriter returns the underlying http.ResponseWriter +// This is useful when you need to pass the response writer to other handlers +func (h *HTTPResponseWriter) UnderlyingResponseWriter() http.ResponseWriter { + return h.resp +} + // StandardMuxAdapter creates routes compatible with standard http.HandlerFunc type StandardMuxAdapter struct { *MuxAdapter