MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / IsNotModified

Function IsNotModified

storage/common/notmodified.go:11–23  ·  view source on GitHub ↗

IsNotModified returns true if a file was not modified according to request/response headers

(reqHeader http.Header, respHeader http.Header)

Source from the content-addressed store, hash-verified

9// IsNotModified returns true if a file was not modified according to
10// request/response headers
11func IsNotModified(reqHeader http.Header, respHeader http.Header) bool {
12 // Etag has higher priority than Last-Modified, so check it first
13 if have, matches := httpheaders.CompareEtag(reqHeader, respHeader); have {
14 return matches
15 }
16
17 // If Etag is not present, check Last-Modified
18 if have, matches := httpheaders.CompareLastModified(reqHeader, respHeader); have {
19 return matches
20 }
21
22 return false
23}

Callers 4

GetObjectMethod · 0.92
GetObjectMethod · 0.92
GetObjectMethod · 0.92
GetObjectMethod · 0.92

Calls 2

CompareEtagFunction · 0.92
CompareLastModifiedFunction · 0.92

Tested by

no test coverage detected