]> git.ipfire.org Git - thirdparty/tornado.git/log
thirdparty/tornado.git
4 days agoMerge pull request #3631 from bdarnell/cve-links branch6.5 stable
Ben Darnell [Tue, 2 Jun 2026 20:07:54 +0000 (16:07 -0400)] 
Merge pull request #3631 from bdarnell/cve-links

docs: Add CVE links to 6.5.6 release notes

4 days agodocs: Use the correct link syntax 3631/head
Ben Darnell [Tue, 2 Jun 2026 20:02:23 +0000 (16:02 -0400)] 
docs: Use the correct link syntax

4 days agodocs: Add CVE links to 6.5.6 release notes
Ben Darnell [Tue, 2 Jun 2026 19:58:39 +0000 (15:58 -0400)] 
docs: Add CVE links to 6.5.6 release notes

10 days agoMerge pull request #3626 from bdarnell/fixes-656 v6.5.6
Ben Darnell [Wed, 27 May 2026 15:02:23 +0000 (11:02 -0400)] 
Merge pull request #3626 from bdarnell/fixes-656

Combined changes for release 6.5.6

10 days agohttpclient_test: Accept an additional error message variant 3626/head
Ben Darnell [Wed, 27 May 2026 14:52:45 +0000 (10:52 -0400)] 
httpclient_test: Accept an additional error message variant

This appears to be a recent libcurl change.

10 days agoRelease notes and version bump for 6.5.6.
Ben Darnell [Wed, 27 May 2026 14:36:21 +0000 (10:36 -0400)] 
Release notes and version bump for 6.5.6.

10 days agosimple_httpclient: Strip auth headers on cross-origin redirects
Ben Darnell [Wed, 27 May 2026 01:30:28 +0000 (21:30 -0400)] 
simple_httpclient: Strip auth headers on cross-origin redirects

When following a redirect to a different origin (scheme, host, or port),
auth-related headers (Authorization and Cookie) should be stripped to
avoid exposing them to the new host.

10 days agospeedups: validate mask length
Ben Darnell [Wed, 27 May 2026 01:17:59 +0000 (21:17 -0400)] 
speedups: validate mask length

The lack of this check permitted a read of up to 3 bytes past the end
of the string in some cases.

10 days agohttp1connection: Enforce max_body_size in _GzipMessageDelegate
Ben Darnell [Tue, 26 May 2026 17:39:53 +0000 (13:39 -0400)] 
http1connection: Enforce max_body_size in _GzipMessageDelegate

This ensures we limit the post-decompression size of the body, and not
only the compressed size (which is enforced via the Content-Length
header at header-processing time).

2 weeks agoauth: Correctly parse check_authentication response
Ben Darnell [Thu, 21 May 2026 20:02:48 +0000 (16:02 -0400)] 
auth: Correctly parse check_authentication response

This previously used substring search, which is incorrect, although
unlikely to be a vulnerability because there are no free-form text
fields allowed in this response format.

2 weeks agoRemove obsolete curl force_timeout workaround
Thomas Kluyver [Wed, 6 May 2026 14:27:56 +0000 (15:27 +0100)] 
Remove obsolete curl force_timeout workaround

2 weeks agoReplace deprecated pycurl IOCTLFUNCTION callback with SEEKFUNCTION
Thomas Kluyver [Wed, 6 May 2026 10:16:36 +0000 (11:16 +0100)] 
Replace deprecated pycurl IOCTLFUNCTION callback with SEEKFUNCTION

2 months agoMerge pull request #3587 from bdarnell/fix-link
Ben Darnell [Wed, 11 Mar 2026 00:54:06 +0000 (20:54 -0400)] 
Merge pull request #3587 from bdarnell/fix-link

docs: Use correct link syntax, not markdown.

2 months agodocs: Use correct link syntax, not markdown. 3587/head
Ben Darnell [Wed, 11 Mar 2026 00:48:55 +0000 (20:48 -0400)] 
docs: Use correct link syntax, not markdown.

2 months agoMerge pull request #3586 from bdarnell/update-cibw v6.5.5
Ben Darnell [Tue, 10 Mar 2026 20:12:29 +0000 (16:12 -0400)] 
Merge pull request #3586 from bdarnell/update-cibw

build: Bump cibuildwheel to 3.4.0

2 months agobuild: Bump cibuildwheel to 3.4.0 3586/head
Ben Darnell [Tue, 10 Mar 2026 17:19:07 +0000 (13:19 -0400)] 
build: Bump cibuildwheel to 3.4.0

2 months agoMerge pull request #3585 from bdarnell/release-655
Ben Darnell [Tue, 10 Mar 2026 17:05:50 +0000 (13:05 -0400)] 
Merge pull request #3585 from bdarnell/release-655

branch6.5: Release 6.5.5

2 months agoRelease notes and version bump for v6.5.5 3585/head
Ben Darnell [Tue, 10 Mar 2026 17:00:44 +0000 (13:00 -0400)] 
Release notes and version bump for v6.5.5

2 months agohttputil: Add CRLF to _FORBIDDEN_HEADER_CHARS_RE
Ben Darnell [Tue, 10 Mar 2026 16:19:50 +0000 (12:19 -0400)] 
httputil: Add CRLF to _FORBIDDEN_HEADER_CHARS_RE

I think these were omitted due to quirks of an older version of the
parsing code. Linefeeds are already effectively prohibited within
header values since they are interpreted as delimiters, so the net
effect of this change is to prohibit bare carriage returns within
header values. This RE is used only when parsing headers inside
multipart/form-data bodies; for HTTP headers CR was already prohibited.

2 months agoweb: Validate characters in all cookie attributes.
Ben Darnell [Fri, 6 Mar 2026 19:50:25 +0000 (14:50 -0500)] 
web: Validate characters in all cookie attributes.

Our previous control character check was missing a check for
U+007F, and also semicolons, which are only allowed in quoted
parts of values. This commit checks all attributes and
updates the set of disallowed characters.

2 months agohttputil: Add limits on multipart form data parsing
Ben Darnell [Tue, 3 Mar 2026 19:36:14 +0000 (14:36 -0500)] 
httputil: Add limits on multipart form data parsing

The new default limits prevent a DoS vulnerability involving
requests with many multipart parts. It also adds a defense-in-depth
limit on the size of multipart headers, which would have mitigated
the vulnerability fixed in 6.5.3.

New data structures are added to allow users to configure these limits,
and to disable multipart parsing entirely if they choose. However,
due to the complexity of the plumbing required to pass these
configuration options through the stack, the only configuration
provided in this commit is the ability to set a global default.

5 months agoMerge pull request #3564 from bdarnell/release-654 v6.5.4
Ben Darnell [Mon, 15 Dec 2025 18:42:10 +0000 (13:42 -0500)] 
Merge pull request #3564 from bdarnell/release-654

Cherry-pick case-insensitive `in` fix for release 6.5.4

5 months agoRelease notes and version bump for 6.5.4 3564/head
Ben Darnell [Mon, 15 Dec 2025 18:36:01 +0000 (13:36 -0500)] 
Release notes and version bump for 6.5.4

5 months agoMake sure that the in-operator on HTTPHeaders is case insensitive
Arnaud Schoonjans [Mon, 15 Dec 2025 11:12:18 +0000 (12:12 +0100)] 
Make sure that the in-operator on HTTPHeaders is case insensitive

5 months agoMerge pull request #3558 from bdarnell/relnotes-653 v6.5.3
Ben Darnell [Thu, 11 Dec 2025 03:30:55 +0000 (22:30 -0500)] 
Merge pull request #3558 from bdarnell/relnotes-653

Release notes and version bump for 6.5.3

5 months agoMerge pull request #3557 from bdarnell/perf-counter-65
Ben Darnell [Thu, 11 Dec 2025 03:24:03 +0000 (22:24 -0500)] 
Merge pull request #3557 from bdarnell/perf-counter-65

branch6.5: Use time.perf_counter instead of time.time for performance tests

5 months agotest: Use time.perf_counter instead of time.time for performance tests 3557/head
Ben Darnell [Thu, 11 Dec 2025 03:00:03 +0000 (22:00 -0500)] 
test: Use time.perf_counter instead of time.time for performance tests

On windows, time.time has low resolution (about 15ms), which makes
performance tests flaky. time.perf_counter has much higher resolution
and is the recommended way to measure elapsed time.

5 months agotox: Pin pycares version 4 due to backwards-incompatible changes
Ben Darnell [Thu, 11 Dec 2025 03:10:20 +0000 (22:10 -0500)] 
tox: Pin pycares version 4 due to backwards-incompatible changes

5 months agoRelease notes and version bump for 6.5.3 3558/head
Ben Darnell [Thu, 11 Dec 2025 02:58:28 +0000 (21:58 -0500)] 
Release notes and version bump for 6.5.3

5 months agoMerge pull request #3555 from bdarnell/release-653
Ben Darnell [Thu, 11 Dec 2025 02:35:56 +0000 (21:35 -0500)] 
Merge pull request #3555 from bdarnell/release-653

Accumulated changes for v6.5.3

5 months agoweb: Harden against invalid HTTP reason phrases 3555/head
Ben Darnell [Wed, 10 Dec 2025 20:15:25 +0000 (15:15 -0500)] 
web: Harden against invalid HTTP reason phrases

We allow applications to set custom reason phrases for the HTTP status
line (to support custom status codes), but if this were exposed to
untrusted data it could be exploited in various ways. This commit
guards against invalid reason phrases in both HTTP headers and in
error pages.

5 months agohttputil: Fix quadratic behavior in _parseparam
Ben Darnell [Wed, 10 Dec 2025 15:55:02 +0000 (10:55 -0500)] 
httputil: Fix quadratic behavior in _parseparam

Prior to this change, _parseparam had O(n^2) behavior when parsing
certain inputs, which could be a DoS vector. This change adapts
logic from the equivalent function in the python standard library
in https://github.com/python/cpython/pull/136072/files

5 months agodemos: Fix open redirects
Ben Darnell [Tue, 9 Dec 2025 15:40:18 +0000 (10:40 -0500)] 
demos: Fix open redirects

Several demos had handlers that redirected to a "next" URL
provided as a query parameter without validating it first.

5 months agodemos: Remove s3server demo
Ben Darnell [Tue, 9 Dec 2025 15:19:34 +0000 (10:19 -0500)] 
demos: Remove s3server demo

This program does not demonstrate anything particularly interesting
about Tornado, nor is it a good stylistic example to follow. Its
handling of path validation is rudimentary and can be insecure in
some configurations. It makes more sense to remove it than to
try and improve it.

5 months agodemos: Remove obsolete note in demos/README.rst
Ben Darnell [Tue, 9 Dec 2025 15:18:36 +0000 (10:18 -0500)] 
demos: Remove obsolete note in demos/README.rst

This note referred to Tornado 6.3, which has been released.

5 months agohttputil: Fix quadratic performance of repeated header lines
Ben Darnell [Tue, 9 Dec 2025 18:27:27 +0000 (13:27 -0500)] 
httputil: Fix quadratic performance of repeated header lines

Previouisly, when many header lines with the same name were found
in an HTTP request or response, repeated string concatenation would
result in quadratic performance. This change does the concatenation
lazily (with a cache) so that repeated headers can be processed
efficiently.

Security: The previous behavior allowed a denial of service attack
via a maliciously crafted HTTP message, but only if the
max_header_size was increased from its default of 64kB.

5 months agoprocess_test: Use isolated mode for subprocess tests
Ben Darnell [Tue, 9 Dec 2025 17:10:18 +0000 (12:10 -0500)] 
process_test: Use isolated mode for subprocess tests

Prompt customizations (notably the PYTHONSTARTUP file used by
vscode's terminal integration) can interfere with tests that run
interactive interpreters in a subprocess. Run those interpreters
in isolated mode to avoid this problem.)

9 months agoMerge pull request #3535 from bdarnell/typo-652
Ben Darnell [Tue, 12 Aug 2025 13:28:29 +0000 (09:28 -0400)] 
Merge pull request #3535 from bdarnell/typo-652

docs: Fix a broken link in release notes

9 months agodocs: Fix a broken link in release notes 3535/head
Ben Darnell [Tue, 12 Aug 2025 13:09:55 +0000 (09:09 -0400)] 
docs: Fix a broken link in release notes

Updates #3532

9 months agoMerge pull request #3533 from bdarnell/typo-652
Ben Darnell [Mon, 11 Aug 2025 13:38:54 +0000 (09:38 -0400)] 
Merge pull request #3533 from bdarnell/typo-652

Fix typo in release notes for 6.5.2

9 months agoFix typo in release notes for 6.5.2 3533/head
Thijs van Dien [Sat, 9 Aug 2025 04:06:49 +0000 (06:06 +0200)] 
Fix typo in release notes for 6.5.2

9 months agoMerge pull request #3529 from bdarnell/relnotes-652 v6.5.2
Ben Darnell [Fri, 8 Aug 2025 17:53:08 +0000 (13:53 -0400)] 
Merge pull request #3529 from bdarnell/relnotes-652

Release notes for 6.5.2

9 months agoRelease notes for 6.5.2 3529/head
Ben Darnell [Fri, 8 Aug 2025 17:41:47 +0000 (13:41 -0400)] 
Release notes for 6.5.2

9 months agoMerge pull request #3527 from bdarnell/backports-6.5.2
Ben Darnell [Thu, 7 Aug 2025 21:07:58 +0000 (17:07 -0400)] 
Merge pull request #3527 from bdarnell/backports-6.5.2

Backport bug fixes to 6.5 branch for 6.5.2

9 months agohttp1connection: Improve error logging for invalid host headers 3527/head
Ben Darnell [Tue, 22 Jul 2025 17:54:03 +0000 (17:54 +0000)] 
http1connection: Improve error logging for invalid host headers

This was previously being logged as an uncaught exception in application
code, which is wrong for a malformed request. HTTPInputError now passes
through the app-error logging to be caught and reported as a 400
(which logs at the warning level to the access log and info to the
general log).

Fixes #3510

9 months agohttputil: Restore the host argument to HTTPServerRequest
Ben Darnell [Thu, 3 Jul 2025 21:40:55 +0000 (17:40 -0400)] 
httputil: Restore the host argument to HTTPServerRequest

This argument was mistakenly removed in Tornado 6.5.0 with no warning;
it is now back but deprecated. The host header should be used instead.

Updates #3468

9 months agoAdd overloads to gen.multi() (#3515)
JR Heard [Wed, 2 Jul 2025 12:44:37 +0000 (05:44 -0700)] 
Add overloads to gen.multi() (#3515)

Add overloads to gen.multi(). Closes #3514.

9 months agohttputil: Remove a debug print left in by mistake
Ben Darnell [Thu, 12 Jun 2025 15:04:46 +0000 (11:04 -0400)] 
httputil: Remove a debug print left in by mistake

Found thanks to #3510

10 months agoMerge pull request #3513 from oliver-sanders/3258.fix
Ben Darnell [Thu, 24 Jul 2025 20:43:55 +0000 (16:43 -0400)] 
Merge pull request #3513 from oliver-sanders/3258.fix

websocket_ping: fix ping interval with non-zero timeout and improve docs

10 months agowebsocket: Expand testing of next-ping calculation 3513/head
Ben Darnell [Thu, 24 Jul 2025 20:37:48 +0000 (20:37 +0000)] 
websocket: Expand testing of next-ping calculation

Includes end-to-end tests that the correct number of pings are sent
(piggybacking on an existing test) and a unit test for the
`ping_sleep_time` calculation.

11 months agowebsocket_ping: fix ping interval with non-zero timeout and improve docs.
Oliver Sanders [Thu, 19 Jun 2025 10:06:29 +0000 (11:06 +0100)] 
websocket_ping: fix ping interval with non-zero timeout and improve docs.

* Fix a bug that caused the ping interval to be less frequent than
  configured.
* Fix erroneous documentation of the websocket_ping_timeout default and
  clarify units for the ping interval.

12 months agoMerge pull request #3503 from bdarnell/multipart-utf8 v6.5.1
Ben Darnell [Thu, 22 May 2025 17:40:17 +0000 (13:40 -0400)] 
Merge pull request #3503 from bdarnell/multipart-utf8

httputil: Fix support for non-latin1 filenames in multipart uploads

12 months agoRelease notes for v6.5.1 3503/head
Ben Darnell [Thu, 22 May 2025 17:25:51 +0000 (13:25 -0400)] 
Release notes for v6.5.1

12 months agohttputil: Fix support for non-latin1 filenames in multipart uploads
Ben Darnell [Thu, 22 May 2025 14:59:48 +0000 (10:59 -0400)] 
httputil: Fix support for non-latin1 filenames in multipart uploads

The change to be stricter about characters allowed in HTTP headers
inadvertently broke support for non-latin1 filenames in multipart
uploads (this was missed in testing because our i18n test case only
used characters in latin1). This commit adds a hacky workaround without
changing any APIs to make it safe for a 6.5.1 patch release; a more
robust solution will follow for future releases.

Fixes #3502

12 months agoMerge pull request #3498 from bdarnell/final-6.5 v6.5.0
Ben Darnell [Thu, 15 May 2025 20:18:19 +0000 (16:18 -0400)] 
Merge pull request #3498 from bdarnell/final-6.5

Final release notes for 6.5.0

12 months agoFinal release notes for 6.5.0 3498/head
Ben Darnell [Wed, 14 May 2025 20:50:57 +0000 (16:50 -0400)] 
Final release notes for 6.5.0

12 months agoMerge pull request #3497 from bdarnell/multipart-log-spam
Ben Darnell [Thu, 15 May 2025 19:49:31 +0000 (15:49 -0400)] 
Merge pull request #3497 from bdarnell/multipart-log-spam

httputil: Raise errors instead of logging in multipart/form-data parsing

12 months agohttputil: Raise errors instead of logging in multipart/form-data parsing 3497/head
Ben Darnell [Thu, 8 May 2025 17:29:43 +0000 (13:29 -0400)] 
httputil: Raise errors instead of logging in multipart/form-data parsing

We used to continue after logging an error, which allowed repeated
errors to spam the logs. The error raised here will still be logged,
but only once per request, consistent with other error handling in
Tornado.

12 months agoasyncio: Preserve contextvars across SelectorThread on Windows (#3479)
bestcondition [Wed, 14 May 2025 17:33:06 +0000 (01:33 +0800)] 
asyncio: Preserve contextvars across SelectorThread on Windows (#3479)

contextvars that were set on the main thread at event loop creation need to be preserved across callbacks that pass through the SelectorThread.

12 months agoMerge pull request #3496 from bdarnell/undeprecate-set-event-loop
Ben Darnell [Tue, 13 May 2025 16:29:33 +0000 (12:29 -0400)] 
Merge pull request #3496 from bdarnell/undeprecate-set-event-loop

testing: Remove deprecation warning filter for set_event_loop

12 months agorequirements: Upgrade tox to 4.26.0 3496/head
Ben Darnell [Tue, 13 May 2025 16:23:30 +0000 (12:23 -0400)] 
requirements: Upgrade tox to 4.26.0

This resolves a conflict between older versions of tox and
Python 3.14b1.

12 months agotesting: Remove deprecation warning filter for set_event_loop
Ben Darnell [Thu, 8 May 2025 19:36:19 +0000 (15:36 -0400)] 
testing: Remove deprecation warning filter for set_event_loop

The deprecation warning for this function was reverted for 3.14b1.

See https://github.com/python/cpython/issues/130322

13 months agobuild: Fix free-threaded build, mark speedups module as no-GIL
Lysandros Nikolaou [Thu, 1 May 2025 18:42:30 +0000 (20:42 +0200)] 
build: Fix free-threaded build, mark speedups module as no-GIL

13 months agoMerge pull request #3492 from bdarnell/relnotes-6.5 v6.5.0b1
Ben Darnell [Tue, 29 Apr 2025 20:36:54 +0000 (16:36 -0400)] 
Merge pull request #3492 from bdarnell/relnotes-6.5

Prepare for release 6.5b1

13 months agoBump version to 6.5b1 3492/head
Ben Darnell [Tue, 29 Apr 2025 20:27:27 +0000 (16:27 -0400)] 
Bump version to 6.5b1

13 months agodocs: Add release notes for 6.5
Ben Darnell [Tue, 29 Apr 2025 19:53:32 +0000 (15:53 -0400)] 
docs: Add release notes for 6.5

13 months agoMerge pull request #3491 from bdarnell/merge-642
Ben Darnell [Tue, 29 Apr 2025 20:08:15 +0000 (16:08 -0400)] 
Merge pull request #3491 from bdarnell/merge-642

docs: Copy 6.4.2 release notes to master branch

13 months agorouting: Fix lint after merge that missed CI 3491/head
Ben Darnell [Tue, 29 Apr 2025 20:03:17 +0000 (16:03 -0400)] 
routing: Fix lint after merge that missed CI

13 months agodocs: Copy 6.4.2 release notes to master branch
Ben Darnell [Thu, 21 Nov 2024 21:26:44 +0000 (16:26 -0500)] 
docs: Copy 6.4.2 release notes to master branch

13 months agoMerge pull request #3455 from mhils/patch-1
Ben Darnell [Tue, 29 Apr 2025 17:14:47 +0000 (13:14 -0400)] 
Merge pull request #3455 from mhils/patch-1

Improve type signature for `_RuleList`

13 months agoMerge pull request #3478 from jrheard-seesaw/3142-gen-multi-typing
Ben Darnell [Mon, 28 Apr 2025 20:30:31 +0000 (16:30 -0400)] 
Merge pull request #3478 from jrheard-seesaw/3142-gen-multi-typing

#3142: Improve usability of multi() and multi_future() type annotations

13 months agoMerge pull request #3490 from bdarnell/prepare-docs
Ben Darnell [Mon, 28 Apr 2025 20:27:29 +0000 (16:27 -0400)] 
Merge pull request #3490 from bdarnell/prepare-docs

web: Update docstrings for prepare and on_finish

13 months agoweb: Update docstrings for prepare and on_finish 3490/head
Ben Darnell [Mon, 28 Apr 2025 19:44:21 +0000 (15:44 -0400)] 
web: Update docstrings for prepare and on_finish

Document the fact that sometimes prepare() is not called, even if
initialize() and on_finish() are.

Updates #3430
Closes #3431

13 months agoMerge pull request #3489 from bdarnell/field-value
Ben Darnell [Mon, 28 Apr 2025 16:57:35 +0000 (12:57 -0400)] 
Merge pull request #3489 from bdarnell/field-value

httputil: Forbid control chars and CR in header values

13 months agohttputil: Forbid control chars and CR in header values 3489/head
Ben Darnell [Sat, 26 Apr 2025 18:31:25 +0000 (14:31 -0400)] 
httputil: Forbid control chars and CR in header values

NUL, CR, and other control characters are not allowed in HTTP header
values.

Fixes #3481

13 months agoMerge pull request #3488 from bdarnell/obs-fold
Ben Darnell [Fri, 25 Apr 2025 19:46:35 +0000 (15:46 -0400)] 
Merge pull request #3488 from bdarnell/obs-fold

httputil: Reject header lines beginning with invalid whitespace

13 months agohttputil: Reject header lines beginning with invalid whitespace 3488/head
Ben Darnell [Fri, 25 Apr 2025 19:31:13 +0000 (15:31 -0400)] 
httputil: Reject header lines beginning with invalid whitespace

The obs-fold feature is defined only for tabs and spaces.
The str.isspace() method also accepts other whitespace characters.
These characters are not valid in HTTP headers and should be treated
as errors instead of triggering line folding.

Fixes #3480

13 months agoMerge pull request #3487 from bdarnell/strict-host
Ben Darnell [Fri, 25 Apr 2025 19:27:27 +0000 (15:27 -0400)] 
Merge pull request #3487 from bdarnell/strict-host

httputil: Process the Host header more strictly

13 months agohttputil: Process the Host header more strictly 3487/head
Ben Darnell [Fri, 25 Apr 2025 18:08:18 +0000 (14:08 -0400)] 
httputil: Process the Host header more strictly

- It is now an error to have multiple Host headers
- The Host header is now mandatory except in HTTP/1.0 mode
- Host headers containing characters that are disallowed by RFC 3986
  are now rejected

Fixes #3468

13 months agoMerge pull request #3486 from bdarnell/websocket-deprecate-callback
Ben Darnell [Fri, 25 Apr 2025 16:00:26 +0000 (12:00 -0400)] 
Merge pull request #3486 from bdarnell/websocket-deprecate-callback

websocket: deprecate callback argument to websocket_connect

13 months agowebsocket: deprecate callback argument to websocket_connect 3486/head
Ben Darnell [Fri, 25 Apr 2025 15:53:44 +0000 (11:53 -0400)] 
websocket: deprecate callback argument to websocket_connect

This was missed in the 6.0-era deprecation of callback arguments.
The on_message_callback remains because even in coroutine-oriented
code it is often more convenient to use a callback than to
loop on read_message.

13 months agoMerge pull request #3485 from bdarnell/template-docs
Ben Darnell [Fri, 25 Apr 2025 15:38:03 +0000 (11:38 -0400)] 
Merge pull request #3485 from bdarnell/template-docs

docs: Document the need to use json_encode in javascript contexts

13 months agoMerge pull request #3477 from bdarnell/header-trailing-whitespace
Ben Darnell [Thu, 24 Apr 2025 20:05:44 +0000 (16:05 -0400)] 
Merge pull request #3477 from bdarnell/header-trailing-whitespace

httputil: Improve handling of trailing whitespace in headers

13 months agodocs: Document the need to use json_encode in javascript contexts 3485/head
Ben Darnell [Thu, 24 Apr 2025 20:01:37 +0000 (16:01 -0400)] 
docs: Document the need to use json_encode in javascript contexts

This has always been necessary but we didn't have any explicit guidance
for using javascript in templates before.

13 months agoMerge pull request #3483 from bdarnell/websocket-docs
Ben Darnell [Thu, 24 Apr 2025 16:36:46 +0000 (12:36 -0400)] 
Merge pull request #3483 from bdarnell/websocket-docs

websocket: Small doc updates

13 months agowebsocket: Small doc updates 3483/head
Ben Darnell [Tue, 22 Apr 2025 17:28:59 +0000 (13:28 -0400)] 
websocket: Small doc updates

- Mention units for ping settings (#2655)
- Remove obsolete reference to 30s default timeout
- Link to a more recent version of python docs

13 months agoMerge pull request #3484 from bdarnell/zizmor-config
Ben Darnell [Tue, 22 Apr 2025 20:41:47 +0000 (16:41 -0400)] 
Merge pull request #3484 from bdarnell/zizmor-config

ci: Add zizmor config file

13 months agoci: Add zizmor config file 3484/head
Ben Darnell [Tue, 22 Apr 2025 19:07:23 +0000 (15:07 -0400)] 
ci: Add zizmor config file

This restores behavior of version 1.5.2 to be more lenient for
pypa and astral-sh repos.

13 months agowebsockets: fix ping_timeout (#3376)
Oliver Sanders [Tue, 22 Apr 2025 17:19:00 +0000 (18:19 +0100)] 
websockets: fix ping_timeout (#3376)

* websockets: fix ping_timeout

* Closes #3258
* Closes #2905
* Closes #2655
* Fixes an issue with the calculation of ping timeout interval that
  could cause connections to be erroneously timed out and closed
  from the server end.

* websocket: Fix lint, remove hard-coded 30s default timeout

* websocket_test: Improve assertion error messages

* websocket_test: Allow a little slack in ping timing

Appears to be necessary on windows.

---------

Co-authored-by: Ben Darnell <ben@bendarnell.com>
13 months agoMerge pull request #3465 from hXtreme/jupyter-1503
Ben Darnell [Sat, 12 Apr 2025 18:46:13 +0000 (14:46 -0400)] 
Merge pull request #3465 from hXtreme/jupyter-1503

Format HTTPError.log_message only if args provided

14 months agoMove Sequence import out of TYPE_CHECKING condition 3478/head
jrheard [Thu, 3 Apr 2025 16:01:54 +0000 (09:01 -0700)] 
Move Sequence import out of TYPE_CHECKING condition

14 months ago#3142: Improve usability of multi() and multi_future() type annotations
jrheard [Wed, 2 Apr 2025 21:52:02 +0000 (14:52 -0700)] 
#3142: Improve usability of multi() and multi_future() type annotations

14 months agohttputil: Improve handling of trailing whitespace in headers 3477/head
Ben Darnell [Wed, 19 Feb 2025 19:06:22 +0000 (14:06 -0500)] 
httputil: Improve handling of trailing whitespace in headers

HTTPHeaders had undocumented assumptions about trailing whitespace,
leading to an unintentional regression in Tornado 6.4.1 in which
passing the arguments of an AsyncHTTPClient header_callback to
HTTPHeaders.parse_line would result in errors.

This commit moves newline parsing from parse to parse_line.
It also strips trailing whitespace from continuation lines (trailing
whitespace is not allowed in HTTP headers, but we didn't reject it
in continuation lines).

This commit also deprecates continuation lines and the legacy
handling of LF without CR.

Fixes #3321

14 months agoimprove error message when run_sync does not complete for reasons other than timeout...
Min RK [Sun, 30 Mar 2025 01:54:43 +0000 (03:54 +0200)] 
improve error message when run_sync does not complete for reasons other than timeout (#3436)

14 months agoMerge pull request #3473 from bdarnell/http-abnf
Ben Darnell [Sun, 30 Mar 2025 01:49:18 +0000 (21:49 -0400)] 
Merge pull request #3473 from bdarnell/http-abnf

httputil: Make parse_request_start_line stricter

14 months agohttputil: Add test for 400 vs 405 method validation 3473/head
Ben Darnell [Thu, 27 Mar 2025 21:36:30 +0000 (17:36 -0400)] 
httputil: Add test for 400 vs 405 method validation

14 months agoMerge pull request #3475 from bdarnell/unpin-alpha
Ben Darnell [Thu, 27 Mar 2025 21:03:15 +0000 (17:03 -0400)] 
Merge pull request #3475 from bdarnell/unpin-alpha

Revert "ci: Temporarily pin 3.14-alpha.4"

14 months agohttputil: Make parse_request_start_line stricter
Ben Darnell [Thu, 27 Mar 2025 20:30:08 +0000 (16:30 -0400)] 
httputil: Make parse_request_start_line stricter

The method is now restricted to being valid token characters as defined
in RFC 9110, allowing us to correctly issue status code 400 or 405
as appropriate (this can make a difference with some caching proxies).

The request-target no longer allows control characters. This is less
strict than the RFC (which does not allow non-ascii characters),
but prioritizes backwards compatibility.

Fixes #3415
Closes #3338

14 months agohttputil: Centralize regexes based directly on RFCs
Ben Darnell [Thu, 27 Mar 2025 20:22:33 +0000 (16:22 -0400)] 
httputil: Centralize regexes based directly on RFCs

This will make it easier to stay in strict conformance with the RFCs.
Note that this commit makes a few small semantic changes to response
start-line parsing: status codes must be exactly three digits, and
control characters are not allowed in reason phrases.

14 months agoRevert "ci: Temporarily pin 3.14-alpha.4" 3475/head
Ben Darnell [Thu, 27 Mar 2025 20:58:36 +0000 (16:58 -0400)] 
Revert "ci: Temporarily pin 3.14-alpha.4"

This reverts commit 5eea9534563340904fe010d0f7433d35cedb8dfb.