Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-135993: Fix IPv6 bug inset_ok_port andreturn_ok_port#136076

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
LamentXU123 wants to merge16 commits intopython:main
base:main
Choose a base branch
Loading
fromLamentXU123:Fix-IPv6-bug-in-set&return-port-ok
Open
Changes from1 commit
Commits
Show all changes
16 commits
Select commitHold shift + click to select a range
8680fa4
Update uuid.rst
LamentXU123Jun 18, 2025
b911f1e
Update uuid.rst
LamentXU123Jun 18, 2025
c69a050
Update Doc/library/uuid.rst
LamentXU123Jun 19, 2025
b55a920
Update uuid.rst
LamentXU123Jun 20, 2025
f129053
sync uuid1 & uuid6 docs
picnixzJun 20, 2025
48064f2
Update cookiejar.py
LamentXU123Jun 28, 2025
e1fe548
Update test_http_cookiejar.py
LamentXU123Jun 28, 2025
f6859dd
Merge branch 'python:main' into Fix-IPv6-bug-in-set&return-port-ok
LamentXU123Jun 28, 2025
05597f8
📜🤖 Added by blurb_it.
blurb-it[bot]Jun 28, 2025
c5ca056
add more test for HDNs
LamentXU123Jun 28, 2025
854422d
add False test
LamentXU123Jun 28, 2025
428096f
Update test_http_cookiejar.py
LamentXU123Jun 28, 2025
312f66f
Update Misc/NEWS.d/next/Library/2025-06-28-14-10-07.gh-issue-135993.G…
LamentXU123Jun 29, 2025
94bb9ab
remove useless `c.clear()`
LamentXU123Jun 29, 2025
24eb5d9
Update test_http_cookiejar.py
LamentXU123Jun 29, 2025
0415d3f
Update 2025-06-28-14-10-07.gh-issue-135993.Gmyux9.rst
LamentXU123Jun 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Update test_http_cookiejar.py
  • Loading branch information
@LamentXU123
LamentXU123 authoredJun 28, 2025
commite1fe548dfde958e9b9b3756625f239a348d641fd
34 changes: 34 additions & 0 deletionsLib/test/test_http_cookiejar.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1262,6 +1262,40 @@ def test_missing_final_slash(self):
c.add_cookie_header(req)
self.assertTrue(req.has_header("Cookie"))

def test_set_ok_port(self):
pol = DefaultCookiePolicy(
rfc2965=True, blocked_domains=[])
c = CookieJar(policy=pol)
headers = ["Set-Cookie: CUSTOMER=WILE_E_COYOTE; path=/; port=1234"]
req = urllib.request.Request("http://127.0.0.1:1234")
res = FakeResponse(headers, "http://127.0.0.1:1234")
self.assertTrue(pol.set_ok_port(c.make_cookies(res, req)[0], req))
self.assertTrue(pol.set_ok_port(c.make_cookies(res, req)[0], req))

c.clear()

req = urllib.request.Request("http://[::1]:1234")
res = FakeResponse(headers, "http://[::1]:1234")
self.assertTrue(pol.set_ok_port(c.make_cookies(res, req)[0], req))
self.assertTrue(pol.set_ok_port(c.make_cookies(res, req)[0], req))

def test_return_ok_port(self):
pol = DefaultCookiePolicy(
rfc2965=True, blocked_domains=[])
c = CookieJar(policy=pol)
headers = ["Set-Cookie: CUSTOMER=WILE_E_COYOTE; path=/; port=1234"]
req = urllib.request.Request("http://127.0.0.1:1234")
res = FakeResponse(headers, "http://127.0.0.1:1234")
self.assertTrue(pol.return_ok_port(c.make_cookies(res, req)[0], req))
self.assertTrue(pol.return_ok_port(c.make_cookies(res, req)[0], req))

c.clear()

req = urllib.request.Request("http://[::1]:1234")
res = FakeResponse(headers, "http://[::1]:1234")
self.assertTrue(pol.return_ok_port(c.make_cookies(res, req)[0], req))
self.assertTrue(pol.return_ok_port(c.make_cookies(res, req)[0], req))

def test_domain_mirror(self):
pol = DefaultCookiePolicy(rfc2965=True)

Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp