MCPcopy
hub / github.com/caddyserver/caddy / initResponseWriter

Method initResponseWriter

modules/caddyhttp/encode/encode.go:230–241  ·  view source on GitHub ↗

initResponseWriter initializes the responseWriter instance allocated in openResponseWriter, enabling mid-stack inlining.

(rw *responseWriter, encodingName string, wrappedRW http.ResponseWriter, isConnect bool)

Source from the content-addressed store, hash-verified

228// initResponseWriter initializes the responseWriter instance
229// allocated in openResponseWriter, enabling mid-stack inlining.
230func (enc *Encode) initResponseWriter(rw *responseWriter, encodingName string, wrappedRW http.ResponseWriter, isConnect bool) *responseWriter {
231 if rww, ok := wrappedRW.(*caddyhttp.ResponseWriterWrapper); ok {
232 rw.ResponseWriter = rww
233 } else {
234 rw.ResponseWriter = &caddyhttp.ResponseWriterWrapper{ResponseWriter: wrappedRW}
235 }
236 rw.encodingName = encodingName
237 rw.config = enc
238 rw.isConnect = isConnect
239
240 return rw
241}
242
243// responseWriter writes to an underlying response writer
244// using the encoding represented by encodingName and

Callers 1

openResponseWriterMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected