initResponseWriter initializes the responseWriter instance allocated in openResponseWriter, enabling mid-stack inlining.
(rw *responseWriter, encodingName string, wrappedRW http.ResponseWriter, isConnect bool)
| 228 | // initResponseWriter initializes the responseWriter instance |
| 229 | // allocated in openResponseWriter, enabling mid-stack inlining. |
| 230 | func (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 |