Skip to content

Releases

Version 0.55.0

Choose a tag to compare

@Kludex Kludex released this 28 Nov 13:01
f06b393

This project needs your help! Let's make this project sustainable together

🐍 Python 3.15 in, Python 3.10 out

uvicorn 0.55.0 supports Python 3.15 and drops Python 3.10. It also removes a 40 ms delay on keep-alive requests with --workers or --reload on the asyncio loop, and fixes several HTTP and WebSocket edge cases.

uv add uvicorn==0.55.0
  • Python 3.10 is no longer supported (#3152). The minimum version is now Python 3.11.
  • Python 3.15 is supported (#3198). Python 3.15 and the free-threaded 3.15t build are tested in CI. 3.15t is not tested on Windows yet.
  • The version now comes from the Git tag (#3261). This only matters if you build uvicorn yourself. The build needs uv-dynamic-versioning, and a build from a GitHub source tarball gets version 0.0.0. Build from the sdist on PyPI, or set UV_DYNAMIC_VERSIONING_BYPASS to the version.

⚑ Faster keep-alive requests and startup

  • Keep-alive requests no longer wait about 40 ms with --workers or --reload on the asyncio loop (#3199). The listening socket is now created with IPPROTO_TCP, so asyncio enables TCP_NODELAY on accepted connections. With 2 workers on Linux, the keep-alive p50 went from 41.01 ms to 0.14 ms. uvloop and zuvloop were not affected.
  • Startup is fast when reload patterns match many directories (#3184). A pattern such as --reload-exclude '.venv/**/*' could take minutes to resolve. With 2,000 matching directories, resolving the patterns went from 120 s to 0.39 s.

πŸ”Œ WebSocket handshakes that fail are closed cleanly

  • A handshake request that websockets cannot parse closes the connection (#3236). With websockets-sansio, a request such as one with a header line over 8 KiB got no response and the connection stayed open. The client now gets a 414 or 431 from websockets 17 or later, or a 400 otherwise, and the connection is closed.
  • Denial responses behave the same on websockets-sansio and wsproto (#3138). Rejecting a connection through the websocket.http.response extension no longer logs ASGI callable returned without completing handshake. on websockets-sansio. A server shutdown while a denial body is still streaming no longer raises LocalProtocolError on wsproto. A client that disconnects during a denial response is reported with code 1006 on both.
  • Connection teardown reaches the WebSocket protocol when the upgrade request fails (#3194). The transport is handed to the WebSocket protocol before it processes the upgrade request.

🧹 Stricter and more accurate request handling

  • HTTP/2 requests without a body no longer hang (#3265). With --http zttp --http2, an application that called receive() before responding never got an answer when the client ended the stream on the HEADERS frame, as curl does.
  • Access logs show the request target as the client sent it (#3195). This is a behavior change. GET /one%2Ftwo was logged as /one/two, and GET /%41 as /A. The access log now uses raw_path.
  • Non-ASCII request targets are rejected on the zttp protocols (#3197). They used to raise UnicodeDecodeError. HTTP/1.1 now answers 400 Bad Request, and HTTP/2 resets only the offending stream.
  • --http httptools strips trailing whitespace from request header values (#3214). X-Test: hello reached the application as b"hello ". h11 and zttp already stripped it.
  • --header without a colon is a usage error (#3200). --header X-Foo used to crash with a ValueError while loading the config.
  • A negative --limit-max-requests-jitter is rejected by the CLI (#3092). Uvicorn used to start and then raise a ValueError from inside the server loop.

Full changelog: 0.54.0...0.55.0

Version 0.54.0

Choose a tag to compare

@Kludex Kludex released this 25 Sep 06:34
3eb9a9a

πŸ“¨ Send metadata after the response body

uvicorn 0.54.0 adds response trailers and 103 Early Hints to its experimental HTTP/2 implementation through zttp.

uv add uvicorn==0.54.0 "zttp>=0.0.34"
  • Send HTTP/2 response trailers (#3146). The ASGI http.response.trailers extension lets applications send metadata, such as checksums, after the response body. Clients must send TE: trailers to receive them. Multiple trailer messages are combined before completing the response.
  • HTTP/2 remains experimental and opt-in. Enable it with --http zttp --http2. Upgrade-based h2c and WebSockets over HTTP/2 remain unsupported.

πŸ’‘ Hint at resources before the final response

  • Send 103 Early Hints over HTTP/2 (#3137). Applications can use the ASGI http.response.early_hint extension to send resource hints before the final response. Each supplied link becomes a separate Link header.

Full changelog: 0.53.0...0.54.0

Version 0.53.0

Choose a tag to compare

@Kludex Kludex released this 14 Sep 07:35
421708f

🌐 Opt-in HTTP/2 support

uvicorn 0.53.0 adds experimental HTTP/2 through zttp, alongside a new zuvloop integration and connection-handling improvements.

uv add uvicorn==0.53.0
  • Serve HTTP/1.1 and HTTP/2 with zttp (#2982, #3101). Install zttp, then enable HTTP/2 with --http zttp --http2. Uvicorn negotiates HTTP/2 over TLS with ALPN and supports cleartext prior knowledge.
  • HTTP/2 remains experimental. Upgrade-based h2c and WebSockets over HTTP/2 are not supported.

βš™οΈ More event loop choice

  • Run Uvicorn with zuvloop (#3104). Install zuvloop separately and select it explicitly with --loop zuvloop on CPython 3.14 or newer.

πŸ›‘οΈ More reliable connections and proxies

  • Honor Connection: close token lists (#3103). Uvicorn now parses comma-separated tokens case-insensitively across HTTP implementations.
  • Trust IPv6 loopback proxies by default (#3119). The default FORWARDED_ALLOW_IPS value now includes ::1.
  • Keep upgraded WebSockets alive (#3107). Uvicorn cancels the HTTP keep-alive timer when the connection becomes a WebSocket.

Full changelog: 0.52.4...0.53.0

Version 0.52.4

Choose a tag to compare

@Kludex Kludex released this 19 Aug 06:00
8988c23

Fixed

  • Remove duplicate Date headers from accepted WebSocket handshakes with websockets-sansio (#3078)

Full Changelog: 0.52.3...0.52.4

Version 0.52.3

Choose a tag to compare

@Kludex Kludex released this 13 Aug 16:46
a68da60

Changed

  • Update zttp to 0.0.24 and use its combined receive path, improving HTTP/1.1 request parsing performance (#3067)

Full Changelog: 0.52.2...0.52.3

Version 0.52.2

Choose a tag to compare

@Kludex Kludex released this 13 Aug 07:01
2a5ff18

Fixed

  • Update zttp to 0.0.22, fixing bodyless request receives and improving HTTP/1 request parsing performance (#3063)

Full Changelog: 0.52.1...0.52.2

Version 0.52.1

Choose a tag to compare

@Kludex Kludex released this 01 Aug 18:18
ee8e45c

Fixed

  • Complete the closing handshake on server-initiated WebSocket closes in the websockets-sansio and wsproto implementations, waiting for the client's close reply with a 10 second timeout instead of resetting the connection (#3053)
  • Add missing write flow control to the websockets-sansio implementation, preventing data truncation on server-initiated closes with large in-flight payloads (#3048)
  • Handle connection loss while a WebSocket write is waiting on backpressure (#3050)
  • Remove duplicate Content-Type and Content-Length headers from WebSocket denial responses on the websockets-sansio implementation, and deliver non-UTF-8 denial bodies intact (#3041)

Full Changelog: 0.52.0...0.52.1

Version 0.52.0

Choose a tag to compare

@Kludex Kludex released this 29 Jul 07:53
8f1b884

This release adds an experimental HTTP/1.1 implementation backed by zttp, a sans-IO HTTP parser I've been developing on the side: a core written in Zig, with bindings to Python. It has been running under a fuzzer for some weeks now, and has been through multiple rounds of security auditing.

It is still experimental, so don't put it in front of production traffic yet. Try it with --http zttp, and please send any feedback to the issue tracker.

Added

  • Add an experimental zttp HTTP/1.1 implementation, selectable with --http zttp (#2979)

Fixed

  • Keep non-ASCII WebSocket request headers intact with websockets 17.0, which encodes them with ISO-8859-1 (#3036)

Full Changelog: 0.51.0...0.52.0

Version 0.51.0

Choose a tag to compare

@Kludex Kludex released this 08 Jul 10:58
e4d0b05

What's Changed

  • Restart workers with overlap on SIGHUP for near-zero-downtime reloads by @Kludex in #3025
  • Remove colorama from the standard extra by @Kludex in #3027

Full Changelog: 0.50.2...0.51.0

Version 0.50.2

Choose a tag to compare

@Kludex Kludex released this 06 Jul 10:06
a1b570c

What's Changed

  • Require websockets>=13.0 for the default sansio implementation by @Kludex in #3021

Full Changelog: 0.50.1...0.50.2