IsNotModified returns true if a file was not modified according to request/response headers
(reqHeader http.Header, respHeader http.Header)
| 9 | // IsNotModified returns true if a file was not modified according to |
| 10 | // request/response headers |
| 11 | func 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 | } |
no test coverage detected