mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-05-11 21:12:39 +02:00
return 504 status for timeout errors
modify custom TimeoutHandler to return 504 error and switch imageproxy to use that func. Fixes #75
This commit is contained in:
parent
e180185856
commit
576b7c023a
2 changed files with 4 additions and 3 deletions
|
|
@ -32,6 +32,7 @@ import (
|
|||
|
||||
"github.com/golang/glog"
|
||||
"github.com/gregjones/httpcache"
|
||||
tphttp "willnorris.com/go/imageproxy/third_party/http"
|
||||
)
|
||||
|
||||
// Proxy serves image requests.
|
||||
|
|
@ -105,7 +106,7 @@ func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
var h http.Handler = http.HandlerFunc(p.serveImage)
|
||||
if p.Timeout > 0 {
|
||||
h = http.TimeoutHandler(h, p.Timeout, "")
|
||||
h = tphttp.TimeoutHandler(h, p.Timeout, "Gateway timeout waiting for remote resource.")
|
||||
}
|
||||
h.ServeHTTP(w, r)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue