mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
net/http: fix ineffective break in etag scanning
In particular, this lead to the code accepting invalid ETags as long as they finished with a '"'. Also remove a duplicate test case. Change-Id: Id59db3ebc4e4969562f891faef29111e77ee0e65 Reviewed-on: https://go-review.googlesource.com/39690 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
0bae9b083b
commit
2c1888bf48
2 changed files with 2 additions and 2 deletions
|
|
@ -1264,10 +1264,10 @@ func Test_scanETag(t *testing.T) {
|
|||
{`"etag-2"`, `"etag-2"`, ""},
|
||||
{`"etag-1", "etag-2"`, `"etag-1"`, `, "etag-2"`},
|
||||
{"", "", ""},
|
||||
{"", "", ""},
|
||||
{"W/", "", ""},
|
||||
{`W/"truc`, "", ""},
|
||||
{`w/"case-sensitive"`, "", ""},
|
||||
{`"spaced etag"`, "", ""},
|
||||
}
|
||||
for _, test := range tests {
|
||||
etag, remain := ExportScanETag(test.in)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue