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

Function CompareEtag

httpheaders/conditional.go:15–17  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

13// - The second boolean indicates that the ETag matches the If-None-Match value,
14// meaning the resource has not been modified.
15func 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.

Callers 1

IsNotModifiedFunction · 0.92

Calls 2

CompareEtagValueFunction · 0.85
GetMethod · 0.65

Tested by

no test coverage detected