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

Function UnquoteEtag

httpheaders/conditional.go:36–40  ·  view source on GitHub ↗

UnquoteEtag removes quotes from the ETag value if they are present. It also removes the weak ETag prefix "W/" if it is present.

(etag string)

Source from the content-addressed store, hash-verified

34// UnquoteEtag removes quotes from the ETag value if they are present.
35// It also removes the weak ETag prefix "W/" if it is present.
36func UnquoteEtag(etag string) string {
37 etag = strings.TrimPrefix(etag, "W/")
38 etag = strings.Trim(etag, `"`)
39 return etag
40}
41
42// CompareLastModified compares the Last-Modified header from the response
43// with the If-Modified-Since header from the request.

Callers 2

computeEtagMethod · 0.92
CompareEtagValueFunction · 0.85

Calls 1

TrimMethod · 0.80

Tested by

no test coverage detected