mirror of
https://github.com/caddyserver/caddy.git
synced 2026-05-30 10:35:18 -04:00
Merge branch 'master' into proxy/keepalive-directive
This commit is contained in:
@@ -27,7 +27,7 @@ type Upstream interface {
|
||||
// The path this upstream host should be routed on
|
||||
From() string
|
||||
// Selects an upstream host to be routed to.
|
||||
Select() *UpstreamHost
|
||||
Select(*http.Request) *UpstreamHost
|
||||
// Checks if subpath is not an ignored path
|
||||
AllowedPath(string) bool
|
||||
}
|
||||
@@ -93,7 +93,7 @@ func (p Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) {
|
||||
// hosts until timeout (or until we get a nil host).
|
||||
start := time.Now()
|
||||
for time.Now().Sub(start) < tryDuration {
|
||||
host := upstream.Select()
|
||||
host := upstream.Select(r)
|
||||
if host == nil {
|
||||
return http.StatusBadGateway, errUnreachable
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user