mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-04-28 14:26:24 +02:00
rename check304 to should304
this reads a little better in if blocks
This commit is contained in:
parent
fb63cbe9df
commit
c81621ae35
2 changed files with 6 additions and 6 deletions
|
|
@ -148,7 +148,7 @@ func (p *Proxy) serveImage(w http.ResponseWriter, r *http.Request) {
|
|||
copyHeader(w, resp, "Etag")
|
||||
copyHeader(w, resp, "Link")
|
||||
|
||||
if is304 := check304(r, resp); is304 {
|
||||
if should304(r, resp) {
|
||||
w.WriteHeader(http.StatusNotModified)
|
||||
return
|
||||
}
|
||||
|
|
@ -233,10 +233,10 @@ func validSignature(key []byte, r *Request) bool {
|
|||
return hmac.Equal(got, want)
|
||||
}
|
||||
|
||||
// check304 checks whether we should send a 304 Not Modified in response to
|
||||
// should304 returns whether we should send a 304 Not Modified in response to
|
||||
// req, based on the response resp. This is determined using the last modified
|
||||
// time and the entity tag of resp.
|
||||
func check304(req *http.Request, resp *http.Response) bool {
|
||||
func should304(req *http.Request, resp *http.Response) bool {
|
||||
// TODO(willnorris): if-none-match header can be a comma separated list
|
||||
// of multiple tags to be matched, or the special value "*" which
|
||||
// matches all etags
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue