CompareEtag compares the ETag from the response header with the If-None-Match header from the request. It returns two boolean values: - The first boolean indicates that both ETag and If-None-Match headers are present - The second boolean indicates that the ETag matches the If-None-Match value, mean
(reqHeader, respHeader http.Header)
| 13 | // - The second boolean indicates that the ETag matches the If-None-Match value, |
| 14 | // meaning the resource has not been modified. |
| 15 | func CompareEtag(reqHeader, respHeader http.Header) (bool, bool) { |
| 16 | return CompareEtagValue(reqHeader.Get(IfNoneMatch), respHeader) |
| 17 | } |
| 18 | |
| 19 | // CompareEtagValue same method as above, but accepts the raw If-None-Match value |
| 20 | // instead of the request header. |
no test coverage detected