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)
| 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. |
| 36 | func 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. |
no test coverage detected