Commit Graph

1482 Commits

Author SHA1 Message Date
Marcelo Trylesinski
479a2c0c89
Version 0.47.0 (#2937) 2026-05-14 06:20:53 -07:00
Marcelo Trylesinski
89347fd166
Add 7-day cooldown for dependency resolution via uv exclude-newer (#2936) 2026-05-12 15:48:51 +00:00
Marcelo Trylesinski
767315b38a
Drop unused contents/actions permissions from zizmor workflow (#2935) 2026-05-12 15:08:08 +02:00
dependabot[bot]
f25ee43e68
chore(deps): bump urllib3 from 2.6.3 to 2.7.0 (#2933) 2026-05-12 07:58:53 +02:00
Stefan Wójcik
8782666189
Fix typo in docs/deployment/index.md. (#2932) 2026-05-09 19:12:56 +02:00
Eugene Toder
ad5ff87c86
Treat fd=0 as a valid file descriptor with reload/workers (#2927)
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
2026-04-30 20:26:13 +02:00
Marcelo Trylesinski
6761b2c8f9
Remove Hugging Face sponsor block from docs (#2923) 2026-04-28 17:24:46 +02:00
Marcelo Trylesinski
438f64834d
Surface sponsors on welcome page and sidebar (#2921) 2026-04-28 10:14:03 +02:00
Marcelo Trylesinski
10ddc6dd29
Add ssl_context_factory for custom SSLContext configuration (#2920) 2026-04-28 06:24:24 +00:00
Marcelo Trylesinski
b499bc4510
Eagerly import the ASGI app in the parent process (#2919) 2026-04-27 23:56:45 +02:00
Marcelo Trylesinski
b224045f59
Version 0.46.0 (#2918) 2026-04-23 06:33:22 +00:00
Marcelo Trylesinski
7375b5bf66
Use bytearray for incoming WebSocket message buffer in websockets-sansio (#2917) 2026-04-22 20:11:28 +00:00
Marcelo Trylesinski
d438fb16fe
Support ws_ping_interval and ws_ping_timeout in wsproto implementation (#2916) 2026-04-22 18:33:16 +00:00
Marcelo Trylesinski
3e6b964466
Support ws_max_size in wsproto implementation (#2915) 2026-04-22 19:17:00 +02:00
Marcelo Trylesinski
2c423bd82b
Version 0.45.0 (#2914) 2026-04-21 11:42:06 +01:00
Marcelo Trylesinski
7f027f8e25
Revert "Emit http.disconnect on server shutdown for streaming responses" (#2829) (#2913) 2026-04-21 10:22:03 +00:00
Marcelo Trylesinski
73a80c3cc8
Add --reset-contextvars flag to isolate ASGI request context (#2912) 2026-04-21 10:46:10 +01:00
Marcelo Trylesinski
45c0b568d3
Revert empty context for ASGI runs (#2911) 2026-04-21 09:51:18 +01:00
Marcelo Trylesinski
850d92656d
Raise helpful ImportError when PyYAML is missing for YAML log config (#2906)
Co-authored-by: Nuno André <mail@nunoand.re>
2026-04-19 10:06:44 +00:00
Marcelo Trylesinski
fdcacb4b83
Accept log_level strings case-insensitively (#2907)
Co-authored-by: Nuno André <mail@nunoand.re>
2026-04-19 10:00:23 +00:00
Marcelo Trylesinski
70f247f9ee
Accept os.PathLike for log_config (#2905)
Co-authored-by: Nuno André <mail@nunoand.re>
2026-04-19 09:57:19 +00:00
Marcelo Trylesinski
18edfa7012
Preserve forwarded client ports in proxy headers middleware (#2903)
Co-authored-by: takeda <411978+takeda@users.noreply.github.com>
2026-04-14 09:56:40 +00:00
Marcelo Trylesinski
77843e06dc
Stabilize websocket keepalive ping test (#2904) 2026-04-14 09:48:53 +00:00
dependabot[bot]
3703339cdc
chore(deps-dev): bump pytest from 9.0.2 to 9.0.3 (#2902)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-14 09:03:58 +02:00
Krishna Chaitanya
fda70f37b0
Add logging configuration documentation with examples (#2870) 2026-04-13 20:40:30 +00:00
Marcelo Trylesinski
f05fc928c0
Fix CodSpeed action ref-version mismatch (#2901) 2026-04-13 20:20:59 +00:00
Marcelo Trylesinski
6cdd61d15e
Add cooldown setting to Dependabot configuration (#2898) 2026-04-12 13:05:29 +00:00
Marcelo Trylesinski
12b823eb8a
Bump locked dependencies (#2894) 2026-04-08 09:35:01 +00:00
Marcelo Trylesinski
1f2abe357a
Add Cloudflare Pages docs preview on pull requests (#2893) 2026-04-07 14:51:52 +00:00
Marcelo Trylesinski
edb54c43c0
Version 0.44.0 (#2890) 2026-04-06 11:21:24 +02:00
Marcelo Trylesinski
029be08867
Implement websocket keepalive pings for websockets-sansio (#2888) 2026-04-06 07:52:58 +00:00
Marcelo Trylesinski
8d397c7319
Version 0.43.0 (#2885) 2026-04-03 18:33:18 +00:00
Sebastián Ramírez
587042d68f
🐛 Emit http.disconnect ASGI receive() event on server shutting down for streaming responses (#2829) 2026-04-03 14:23:03 +00:00
dependabot[bot]
c9a75fb67b
chore(deps): bump the github-actions group with 3 updates (#2878) 2026-04-01 04:30:52 -04:00
dependabot[bot]
84fd578224
chore(deps): bump pygments from 2.19.2 to 2.20.0 (#2877)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-31 09:44:16 -04:00
Harsha Vashisht
cd52d34b55
Use native context parameter for create_task on Python 3.11+ (#2859)
## Summary

Both HTTP protocol implementations (`h11_impl.py` and
`httptools_impl.py`) use
`contextvars.Context().run(loop.create_task, ...)` to start ASGI tasks
with a
fresh context. Python 3.11 added a `context=` parameter to
`create_task()`,
which avoids the extra indirection through `Context.run()`.

This has been a known TODO in the codebase for a while. Under
high-concurrency
workloads, the `Context().run()` wrapper adds a small but measurable
overhead
per request compared to the native kwarg, since it has to set up and
tear down
the context activation around the call.

The change uses `sys.version_info` to branch at runtime — 3.11+ gets the
native
kwarg, older versions keep the existing behavior. Coverage pragmas
follow the
existing convention in `_types.py` (`py-lt-311` / `py-gte-311` on the
branch
lines).

---------

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
2026-03-28 11:45:30 +00:00
Marcelo Trylesinski
5211880320
Drop cast in ASGI types (#2875) 2026-03-28 11:20:47 +01:00
Marcelo Trylesinski
1cb8e747e2
Add websocket 500 fallback header test (#2874)
## Summary
- extend the invalid websocket HTTP response regression test
- assert the 500 fallback includes content-length and connection headers

## Testing
- uv run pytest tests/protocols/test_websocket.py -k invalid_status -q
2026-03-28 10:09:29 +00:00
dependabot[bot]
28efbb24bd
chore(deps-dev): bump cryptography from 46.0.5 to 46.0.6 (#2873)
Bumps [cryptography](https://github.com/pyca/cryptography) from 46.0.5
to 46.0.6.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst">cryptography's
changelog</a>.</em></p>
<blockquote>
<p>46.0.6 - 2026-03-25</p>
<pre><code>
* **SECURITY ISSUE**: Fixed a bug where name constraints were not
applied
  to peer names during verification when the leaf certificate contains a
wildcard DNS SAN. Ordinary X.509 topologies are not affected by this
bug,
including those used by the Web PKI. Credit to **Oleh Konko (1seal)**
for
  reporting the issue. **CVE-2026-34073**
<p>.. _v46-0-5:<br />
</code></pre></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="91d728897b"><code>91d7288</code></a>
Cherry-pick <a
href="https://redirect.github.com/pyca/cryptography/issues/14542">#14542</a>
(<a
href="https://redirect.github.com/pyca/cryptography/issues/14543">#14543</a>)</li>
<li>See full diff in <a
href="https://github.com/pyca/cryptography/compare/46.0.5...46.0.6">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cryptography&package-manager=uv&previous-version=46.0.5&new-version=46.0.6)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/Kludex/uvicorn/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-28 11:03:41 +01:00
Marcelo Trylesinski
042ffeb7d6
ci: add zizmor (#2872) 2026-03-28 09:39:39 +00:00
dependabot[bot]
c61f9d4ebd
chore(deps): bump requests from 2.32.5 to 2.33.0 (#2871)
Bumps [requests](https://github.com/psf/requests) from 2.32.5 to 2.33.0.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.32.5...v2.33.0)

---
updated-dependencies:
- dependency-name: requests
  dependency-version: 2.33.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-27 08:42:53 +01:00
Marcelo Trylesinski
02bed6f8c3
Version 0.42.0 (#2852)
* Version 0.42.0

* Remove benchmark entries from release notes

* Remove docs entry from release notes
2026-03-16 06:11:15 +00:00
Marcelo Trylesinski
d8f2501316
chore: pre-create Config objects in benchmarks to measure protocol hot paths (#2851)
Config.__init__ calls dictConfig() on every construction, which
dominated benchmark time (~70% for httptools). Pre-creating configs
at module level removes this setup noise so CodSpeed measures the
actual protocol work.
2026-03-16 05:12:05 +01:00
Marcelo Trylesinski
9dbb7836bb
Add WebSocket protocol benchmarks for wsproto and websockets-sansio (#2849)
Benchmark handshake and text frame sending using the same mock
transport approach as HTTP benchmarks. The legacy websockets
implementation is excluded as it manages its own internal tasks.
2026-03-15 17:07:06 +00:00
Marcelo Trylesinski
b3c69da8c1
Use bytearray for request body accumulation (#2845)
* Use bytearray for request body accumulation

Accumulating request body with bytes += creates a new bytes object on
every chunk, leading to O(n^2) allocation for fragmented bodies.
bytearray extends in-place (amortized O(1)), avoiding the quadratic cost.

* Add fragmented body benchmark for chunked body accumulation

Sends 100KB in 390 x 256-byte chunks to exercise the body += path
that triggers O(n^2) allocation with bytes concatenation.

* Revert "Add fragmented body benchmark for chunked body accumulation"

This reverts commit 47662509c1.
2026-03-15 17:16:56 +01:00
Marcelo Trylesinski
3f3ebee20f
Disable pytest-xdist for CodSpeed benchmark runs (#2847)
CodSpeed instrumentation does not work with parallel test execution.
Pass -n 0 to disable xdist workers.
2026-03-15 16:10:36 +00:00
Marcelo Trylesinski
d072de754f
Add fragmented body benchmark for chunked body accumulation (#2846)
Sends 100KB in 390 x 256-byte chunks to exercise the body += path
that triggers O(n^2) allocation with bytes concatenation.
2026-03-15 16:01:51 +00:00
Marcelo Trylesinski
e300c2c75d
Add CodSpeed benchmark suite for HTTP protocol hot paths (#2844)
* Add CodSpeed benchmark suite for HTTP protocol hot paths

* Suppress mypy operator error on ASGI message body concatenation

* Use OIDC token and pin CodSpeed action to latest commit
2026-03-15 15:37:09 +00:00
Kadir Can Ozden
1fa697651b
Escape brackets and backslash in httptools HEADER_RE regex (#2824)
* Fix broken HEADER_RE regex in httptools HTTP implementation

The character class in HEADER_RE has unescaped [ and ] which causes
the regex to be parsed incorrectly. The ] prematurely closes the
character class after ':', so the remaining characters '={} \t"'
are treated as a literal sequence rather than part of the class.

As a result the regex never matches any invalid header name character
and the validation at line 496 is completely non-functional.

This escapes the brackets and backslash properly inside the
character class so all RFC 7230 header name separators are caught.

* Add tests for invalid HTTP header name validation

* Add comment explaining why no 500 is sent on invalid header name

* Use backticks around response_started in comment

---------

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
2026-03-15 14:00:30 +00:00
Kadir Can Ozden
59ec1de7a4
Fix multiple issues in websockets sansio implementation (#2825) 2026-03-15 11:22:13 +01:00