mirror of
https://github.com/containous/traefik.git
synced 2024-12-25 23:21:40 +03:00
82651985c4
This reverts commit 73a1b172ed
.
21 lines
422 B
Go
21 lines
422 B
Go
package middlewares
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
// SaveBackend sends the backend name to the logger.
|
|
type SaveBackend struct {
|
|
next http.Handler
|
|
}
|
|
|
|
// NewSaveBackend creates a SaveBackend
|
|
func NewSaveBackend(next http.Handler) *SaveBackend {
|
|
return &SaveBackend{next}
|
|
}
|
|
|
|
func (sb *SaveBackend) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
|
|
saveBackendNameForLogger(r, (*r.URL).String())
|
|
sb.next.ServeHTTP(rw, r)
|
|
}
|