mirror of
https://github.com/caddyserver/caddy.git
synced 2025-06-01 00:43:23 +08:00
caddyhttp: Impl ResponseWriter.Unwrap()
, prep for Go 1.20's ResponseController
(#5509)
* feat: add support for ResponseWriter.Unwrap() * cherry-pick Francis' code
This commit is contained in:
@ -636,6 +636,12 @@ func (wr statusOverrideResponseWriter) WriteHeader(int) {
|
||||
wr.ResponseWriter.WriteHeader(wr.code)
|
||||
}
|
||||
|
||||
// Unwrap returns the underlying ResponseWriter, necessary for
|
||||
// http.ResponseController to work correctly.
|
||||
func (wr statusOverrideResponseWriter) Unwrap() http.ResponseWriter {
|
||||
return wr.ResponseWriter
|
||||
}
|
||||
|
||||
// osFS is a simple fs.FS implementation that uses the local
|
||||
// file system. (We do not use os.DirFS because we do our own
|
||||
// rooting or path prefixing without being constrained to a single
|
||||
|
Reference in New Issue
Block a user