Skip to content
Myr

Fix IPv6 session transactions

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by lkk7 · committed by David Lord · parent 514fc6b · Browse files · 2 files+15 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+15 added−1 removed

  • tests:+14 added−0 removed
  • other:+1 added−1 removed

2 files+15 added−1 removed

modified:src/flask/testing.py+1 added-1 removed
175 unmodified lines
176 with ctx:177 app.session_interface.save_session(app, sess, resp)178179 self._update_cookies_from_response(180 ctx.request.host.partition(":")[0],180 urlsplit(ctx.request.host_url).hostname or "localhost",181 ctx.request.path,182 resp.headers.getlist("Set-Cookie"),183 )184
114 unmodified lines
modified:tests/test_testing.py+14 added
169 unmodified lines
170 assert len(sess) == 1171 assert sess["foo"] == [42]172173174def test_session_transaction_ipv6(app):175 base_url = "http://[::1]:8000/"176 client = app.test_client()177178 @app.get("/")179 def index():180 return str(flask.session.get("value"))181182 with client.session_transaction(base_url=base_url) as sess:183 sess["value"] = 42184185 assert client.get("/", base_url=base_url).text == "42"186187188def test_session_transactions_no_null_sessions():189 app = flask.Flask(__name__)190191 with app.test_client() as c:
207 unmodified lines