We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 66e216f commit a83c8ccCopy full SHA for a83c8cc
1 file changed
helpers.go
@@ -493,15 +493,17 @@ func sortAcceptedTypes(at []acceptedType) {
493
494
// normalizeEtag validates an entity tag and returns the value without quotes.
495
// weak is true if the tag has the "W/" prefix.
496
-func normalizeEtag(t string) (string, weak, ok bool) {
497
- weak = strings.HasPrefix(t, "W/")
+func normalizeEtag(t string) (string, bool, bool) {
+ weak := strings.HasPrefix(t, "W/")
498
if weak {
499
t = t[2:]
500
}
501
if len(t) < 2 || t[0] != '"' || t[len(t)-1] != '"' {
502
return "", weak, false
503
504
- return t[1 : len(t)-1], weak, true
+ // strip the two surrounding quotes
505
+ inner := t[1 : len(t)-1]
506
+ return inner, weak, true
507
508
509
// matchEtag performs a weak comparison of entity tags according to
0 commit comments