mirror of
https://github.com/golang/go
synced 2024-11-22 08:34:40 -07:00
Remove the path=/
restriction
This commit is contained in:
parent
e581799756
commit
7df8738b80
@ -319,8 +319,8 @@ func (c *Cookie) Valid() error {
|
||||
}
|
||||
}
|
||||
if c.Partitioned {
|
||||
if !c.Secure || c.Path != "/" {
|
||||
return errors.New("http: partitioned cookies must be set with Secure and Path=/")
|
||||
if !c.Secure {
|
||||
return errors.New("http: partitioned cookies must be set with Secure")
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
@ -574,7 +574,6 @@ func TestCookieValid(t *testing.T) {
|
||||
{&Cookie{Name: ""}, false},
|
||||
{&Cookie{Name: "invalid-value", Value: "foo\"bar"}, false},
|
||||
{&Cookie{Name: "invalid-path", Path: "/foo;bar/"}, false},
|
||||
{&Cookie{Name: "invalid-path-for-partitioned", Value: "foo", Path: "/bar", Secure: true, Partitioned: true}, false},
|
||||
{&Cookie{Name: "invalid-secure-for-partitioned", Value: "foo", Path: "/", Secure: false, Partitioned: true}, false},
|
||||
{&Cookie{Name: "invalid-domain", Domain: "example.com:80"}, false},
|
||||
{&Cookie{Name: "invalid-expiry", Value: "", Expires: time.Date(1600, 1, 1, 1, 1, 1, 1, time.UTC)}, false},
|
||||
|
Loading…
Reference in New Issue
Block a user