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, 16:00 UTC
encode: Implement Flush for legacy compatibility
(By sponsor request)
Matthew Holt committed
Feb 16, 2026 at 15:59 UTC
bdcdaf77ba6276b5ead20fa2518e00391150523d
1 file changed
+8
modules/caddyhttp/encode/encode.go
+8
@@ -307,6 +307,14 @@ func (rw *responseWriter) FlushError() error {
307
return http.NewResponseController(rw.ResponseWriter).Flush()
308
}
309
310
+// Flush calls FlushError() and simply discards any error. It is only implemented for backwards
311
+// compatibility with legacy code that does not use FlushError; we know at least one sponsor
312
+// needs this. It should not be relied upon as a stable part of the exported API, as it may be
313
+// removed in the future.
314
+func (rw *responseWriter) Flush() {
315
+ _ = rw.FlushError()
316
+}
317
+
318
// Write writes to the response. If the response qualifies,
319
// it is encoded using the encoder, which is initialized
320
// if not done so already.