@marcel91200 / caddy Mirror · read-only / commits / 716d72e4
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 11, 23:30 UTC

intercept: implement Unwrap for interceptedResponseHandler (#7016)

WeidiDeng committed May 13, 2025 at 02:15 UTC 716d72e47538cc4f7bab43b1d973e0f8aa0a9fba
1 file changed +5
modules/caddyhttp/intercept/intercept.go
+5
@@ -118,6 +118,11 @@ func (irh interceptedResponseHandler) WriteHeader(statusCode int) {
118 irh.ResponseRecorder.WriteHeader(statusCode)
119 }
120
121 +// EXPERIMENTAL: Subject to change or removal.
122 +func (irh interceptedResponseHandler) Unwrap() http.ResponseWriter {
123 + return irh.ResponseRecorder
124 +}
125 +
126 // EXPERIMENTAL: Subject to change or removal.
127 func (ir Intercept) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error {
128 buf := bufPool.Get().(*bytes.Buffer)