mirror of
https://github.com/willnorris/imageproxy.git
synced 2024-12-16 21:56:43 -05:00
make 'cached' a bool
This commit is contained in:
parent
8484518c93
commit
4e97a7ea8f
1 changed files with 3 additions and 3 deletions
|
@ -197,12 +197,12 @@ func (p *Proxy) serveImage(w http.ResponseWriter, r *http.Request) {
|
|||
// close the original resp.Body, even if we wrap it in a NopCloser below
|
||||
defer resp.Body.Close()
|
||||
|
||||
cached := resp.Header.Get(httpcache.XFromCache)
|
||||
cached := resp.Header.Get(httpcache.XFromCache) == "1"
|
||||
if p.Verbose {
|
||||
p.logf("request: %+v (served from cache: %t)", *actualReq, cached == "1")
|
||||
p.logf("request: %+v (served from cache: %t)", *actualReq, cached)
|
||||
}
|
||||
|
||||
if cached == "1" {
|
||||
if cached {
|
||||
requestServedFromCacheCount.Inc()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue