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:
Kévin Dunglas
2023-04-27 01:44:01 +02:00
committed by GitHub
parent 2b04e09fa7
commit 1c9ea0113d
5 changed files with 30 additions and 0 deletions

View File

@ -66,3 +66,9 @@ func (d *delegator) WriteHeader(code int) {
d.status = code
d.ResponseWriter.WriteHeader(code)
}
// Unwrap returns the underlying ResponseWriter, necessary for
// http.ResponseController to work correctly.
func (d *delegator) Unwrap() http.ResponseWriter {
return d.ResponseWriter
}