mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-23 08:48:32 +02:00
fix(idlewatcher): not started for docker containers
This commit is contained in:
@@ -38,6 +38,10 @@ func (w *Watcher) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
default:
|
default:
|
||||||
f := &ForceCacheControl{expires: w.expires().Format(http.TimeFormat), ResponseWriter: rw}
|
f := &ForceCacheControl{expires: w.expires().Format(http.TimeFormat), ResponseWriter: rw}
|
||||||
|
w, ok := watcherMap[w.Key()] // could've been reloaded
|
||||||
|
if !ok {
|
||||||
|
return
|
||||||
|
}
|
||||||
w.rp.ServeHTTP(f, r)
|
w.rp.ServeHTTP(f, r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,6 +151,10 @@ func (r *Route) Validate() gperr.Error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if r.Container != nil && r.Container.IdlewatcherConfig != nil {
|
||||||
|
r.Idlewatcher = r.Container.IdlewatcherConfig
|
||||||
|
}
|
||||||
|
|
||||||
// return error if route is localhost:<godoxy_port>
|
// return error if route is localhost:<godoxy_port>
|
||||||
switch r.Host {
|
switch r.Host {
|
||||||
case "localhost", "127.0.0.1":
|
case "localhost", "127.0.0.1":
|
||||||
|
|||||||
Reference in New Issue
Block a user