Skip to content

Commit 19d52f4

Browse files
committed
fix(cookie): Remove partitioned field
The partitioned field is only available in go 1.23+ and so should be removed from the library as this version does not yet require v1.23+. See golang/go#62490 (comment) Fixes #277
1 parent c373b3e commit 19d52f4

File tree

6 files changed

+8
-18
lines changed

6 files changed

+8
-18
lines changed

cookie.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ func newCookieFromOptions(name, value string, options *Options) *http.Cookie {
1515
MaxAge: options.MaxAge,
1616
Secure: options.Secure,
1717
HttpOnly: options.HttpOnly,
18-
Partitioned: options.Partitioned,
1918
}
2019

2120
}

cookie_go111.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ func newCookieFromOptions(name, value string, options *Options) *http.Cookie {
1616
Secure: options.Secure,
1717
HttpOnly: options.HttpOnly,
1818
SameSite: options.SameSite,
19-
Partitioned: options.Partitioned,
2019
}
2120

2221
}

cookie_test.go

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,15 @@ func TestNewCookieFromOptions(t *testing.T) {
1414
maxAge int
1515
secure bool
1616
httpOnly bool
17-
partitioned bool
1817
}{
19-
{"", "bar", "/foo/bar", "foo.example.com", 3600, true, true, true},
20-
{"foo", "", "/foo/bar", "foo.example.com", 3600, true, true, true},
21-
{"foo", "bar", "", "foo.example.com", 3600, true, true, true},
22-
{"foo", "bar", "/foo/bar", "", 3600, true, true, true},
23-
{"foo", "bar", "/foo/bar", "foo.example.com", 0, true, true, true},
24-
{"foo", "bar", "/foo/bar", "foo.example.com", 3600, false, true, true},
25-
{"foo", "bar", "/foo/bar", "foo.example.com", 3600, true, false, true},
26-
{"foo", "bar", "/foo/bar", "foo.example.com", 3600, true, true, false},
18+
{"", "bar", "/foo/bar", "foo.example.com", 3600, true, true},
19+
{"foo", "", "/foo/bar", "foo.example.com", 3600, true, true},
20+
{"foo", "bar", "", "foo.example.com", 3600, true, true},
21+
{"foo", "bar", "/foo/bar", "", 3600, true, true},
22+
{"foo", "bar", "/foo/bar", "foo.example.com", 0, true, true},
23+
{"foo", "bar", "/foo/bar", "foo.example.com", 3600, false, true},
24+
{"foo", "bar", "/foo/bar", "foo.example.com", 3600, true, false},
25+
{"foo", "bar", "/foo/bar", "foo.example.com", 3600, true, true},
2726
}
2827
for i, v := range tests {
2928
options := &Options{
@@ -32,7 +31,6 @@ func TestNewCookieFromOptions(t *testing.T) {
3231
MaxAge: v.maxAge,
3332
Secure: v.secure,
3433
HttpOnly: v.httpOnly,
35-
Partitioned: v.partitioned,
3634
}
3735
cookie := newCookieFromOptions(v.name, v.value, options)
3836
if cookie.Name != v.name {
@@ -56,8 +54,5 @@ func TestNewCookieFromOptions(t *testing.T) {
5654
if cookie.HttpOnly != v.httpOnly {
5755
t.Fatalf("%v: bad cookie httpOnly: got %v, want %v", i+1, cookie.HttpOnly, v.httpOnly)
5856
}
59-
if cookie.Partitioned != v.partitioned {
60-
t.Fatalf("%v: bad cookie partitioned: got %v, want %v", i+1, cookie.Partitioned, v.partitioned)
61-
}
6257
}
6358
}

options.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,4 @@ type Options struct {
1616
MaxAge int
1717
Secure bool
1818
HttpOnly bool
19-
Partitioned bool
2019
}

options_go111.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ type Options struct {
1818
MaxAge int
1919
Secure bool
2020
HttpOnly bool
21-
Partitioned bool
2221
// Defaults to http.SameSiteDefaultMode
2322
SameSite http.SameSite
2423
}

vendor/github.com/gorilla/securecookie/README.md

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)