diff --git a/CHANGELOG.md b/CHANGELOG.md index afa75a697..a1b5724e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ +## [v2.2.11](https://github.com/containous/traefik/tree/v2.2.11) (2020-09-07) +[All Commits](https://github.com/containous/traefik/compare/v2.2.10...v2.2.11) + +**Bug fixes:** +- **[middleware]** fix: header middleware response writer. ([#7252](https://github.com/containous/traefik/pull/7252) by [ldez](https://github.com/ldez)) + +**Documentation:** +- **[healthcheck]** Clarified hostname documentation for load balancer healthcheck ([#7254](https://github.com/containous/traefik/pull/7254) by [AndrewSav](https://github.com/AndrewSav)) + ## [v2.2.10](https://github.com/containous/traefik/tree/v2.2.10) (2020-09-04) -[All Commits](https://github.com/containous/traefik/compare/v2.2.0...v2.2.10) +[All Commits](https://github.com/containous/traefik/compare/v2.2.7...v2.2.10) **Bug fixes:** - **[acme]** Update go-acme/lego to v4.0.1 ([#7238](https://github.com/containous/traefik/pull/7238) by [ldez](https://github.com/ldez)) diff --git a/docs/content/routing/services/index.md b/docs/content/routing/services/index.md index 7a85a0039..cbc271dfc 100644 --- a/docs/content/routing/services/index.md +++ b/docs/content/routing/services/index.md @@ -317,7 +317,7 @@ Below are the available options for the health check mechanism: - `path` is appended to the server URL to set the health check endpoint. - `scheme`, if defined, will replace the server URL `scheme` for the health check endpoint -- `hostname`, if defined, will replace the server URL `hostname` for the health check endpoint. +- `hostname`, if defined, will apply `Host` header `hostname` to the the health check request. - `port`, if defined, will replace the server URL `port` for the health check endpoint. - `interval` defines the frequency of the health check calls. - `timeout` defines the maximum duration Traefik will wait for a health check request before considering the server failed (unhealthy). diff --git a/pkg/middlewares/headers/responsewriter.go b/pkg/middlewares/headers/responsewriter.go index 274a58181..899e8259c 100644 --- a/pkg/middlewares/headers/responsewriter.go +++ b/pkg/middlewares/headers/responsewriter.go @@ -1,6 +1,9 @@ package headers import ( + "bufio" + "fmt" + "net" "net/http" "github.com/containous/traefik/v2/pkg/log" @@ -73,3 +76,19 @@ func (w *responseModifier) Write(b []byte) (int, error) { return w.w.Write(b) } + +// Hijack hijacks the connection. +func (w *responseModifier) Hijack() (net.Conn, *bufio.ReadWriter, error) { + if h, ok := w.w.(http.Hijacker); ok { + return h.Hijack() + } + + return nil, nil, fmt.Errorf("not a hijacker: %T", w.w) +} + +// Flush sends any buffered data to the client. +func (w *responseModifier) Flush() { + if flusher, ok := w.w.(http.Flusher); ok { + flusher.Flush() + } +}