mirror of
https://github.com/caddyserver/caddy.git
synced 2026-08-04 06:53:36 +00: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:
parent
2b04e09fa7
commit
1c9ea0113d
5 changed files with 30 additions and 0 deletions
|
|
@ -299,6 +299,11 @@ func (rw *responseWriter) Close() error {
|
|||
return err
|
||||
}
|
||||
|
||||
// Unwrap returns the underlying ResponseWriter.
|
||||
func (rw *responseWriter) Unwrap() http.ResponseWriter {
|
||||
return rw.HTTPInterfaces
|
||||
}
|
||||
|
||||
// init should be called before we write a response, if rw.buf has contents.
|
||||
func (rw *responseWriter) init() {
|
||||
if rw.Header().Get("Content-Encoding") == "" && isEncodeAllowed(rw.Header()) &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue