unstale

pypi / starlette

starlette

What changed in starlette 0.49 to 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.

19 breaking3 security2 deprecations15 new APIs and options8 performance12 behavior and defaults3 tooling39 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

starlette 188 changes

Breaking changes 18

  • Values from env files have one pair of matching outer quotes stripped.

    1.10.0release notes

  • Range is ignored for methods other than GET and HEAD, so a POST endpoint returning a file sends the full file.

    1.10.0release notes

  • FormParser.messages is gone because the parser no longer uses FormMessage.

    1.10.0release notes

  • Equality preserves the order of values under a repeated key, matching getlist(); keys can still appear in any order.

    1.10.0release notes

  • Path parameter values that look like placeholders are preserved rather than being substituted again.

    1.10.0release notes

  • Percent-encode ?, #, \ and a leading // in the request path when building request.url.

    1.9.0release notes

  • TestClient response bodies are streamed, so client.stream returns before the application finishes; closing an unfinished streamed response cancels the application.

    1.9.0release notes

  • By default, excludes native gRPC media types from compression.

    1.8.0release notes

  • Requires Python 3.11 or later; Python 3.10 is no longer supported.

    1.8.0release notes

  • Requires anyio>=4.0.0,<5, dropping support for AnyIO 3.

    1.7.0release notes

  • Background tasks now run only after the response is sent.

    1.7.0release notes

  • Invalid multipart parser input now returns 400.

    1.7.0release notes

  • Disconnected WebSocket operations now raise WebSocketDisconnected, a RuntimeError subclass.

    1.7.0release notes

  • FileResponse limits responses to 100 ranges.

    1.5.1release notes

  • FormParser now enforces max_fields and max_part_size limits, including in parser callbacks.

    1.3.1release notessecurity advisory

  • Adds an assertion error when the request parameter is not of type Request.

    1.2.1release notes

  • HTTPEndpoint now dispatches only standard HTTP verbs.

    1.1.0release notessecurity advisory

  • StaticFiles.lookup_path now rejects absolute paths.

    1.1.0release notessecurity advisory

Security 2

Deprecations 2

  • FormMessage is deprecated; calling it emits a StarletteDeprecationWarning, and the parser no longer uses it.

    1.10.0release notes

  • Use StarletteDeprecationWarning instead of DeprecationWarning for Starlette deprecation warnings.

    1.3.1release notes

New APIs and options 12

  • Adds a method to send HTTP 103 Early Hints through the ASGI http.response.early_hint extension.

    1.8.0release notes

  • Adds experimental HTTP server tracing with URL exclusions and custom tracer providers; its API and emitted telemetry may change in minor releases without a deprecation period.

    1.7.0release notes

  • Supports the QUERY HTTP method in HTTPEndpoint, CORS, and OpenAPI 3.2 schema generation.

    1.7.0release notes

  • Adds the partitioned option on Python 3.14 and later.

    1.7.0release notes

  • TestClient captures HTTP response trailers and exposes them through the response extensions mapping.

    1.7.0release notes

  • Exposes the matched route through the request scope.

    1.7.0release notes

  • Supports partitioned cookies in session middleware.

    1.7.0release notes

  • Implements identity on SimpleUser and UnauthenticatedUser.

    1.7.0release notes

  • Exposes http.response.debug info via response extensions.

    1.6.0release notes

  • Adds max_body_size to Starlette and route classes.

    1.6.0release notes

  • Adds the exclude_content_types parameter to let developers specify content types that GZipMiddleware should exclude.

    1.5.0release notes

  • The full extra now includes httpx2.

    1.3.0release notes

Performance 7

  • URL-encoded form parsing builds fields in parser callbacks instead of queueing and replaying events, reducing CPU and memory use.

    1.10.0release notes

  • Starlette clears the traceback after an exception handler runs, so reused exception instances no longer pin per-request objects in memory.

    1.10.0release notes

  • Route matching compares Match members by identity, reducing instructions per dispatch in routing benchmarks.

    1.10.0release notes

  • ServerErrorMiddleware offloads debug traceback rendering to a worker thread.

    1.7.0release notes

  • Compression resources are allocated lazily, reducing upfront resource allocation.

    1.4.0release notes

  • GZipMiddleware uses zlib.compressobj instead of GzipFile for compression.

    1.4.0release notes

  • Large GZip compression is offloaded.

    1.4.0release notes

Behavior and default changes 10

  • Host names are matched case-insensitively.

    1.9.0release notes

  • Sends http.response.start immediately for responses with an existing Content-Encoding, status 206, or an excluded content type, rather than waiting for the first body chunk.

    1.8.0release notes

  • Allows non-standard status codes without an explicit detail.

    1.7.0release notes

  • TrustedHostMiddleware and TestClient support IPv6 hosts.

    1.7.0release notes

  • Flushes GZip output for each streamed chunk.

    1.5.0release notes

  • Expands the content types excluded from compression by default.

    1.5.0release notes

  • The default for thread_minimum_size in GZipResponder changed; the notes do not specify the new value.

    1.4.1release notes

  • request.url is built from structured components.

    1.3.0release notes

  • The media type fallback is now application/octet-stream.

    1.1.0release notes

  • Starlette has reached its first stable release.

    1.0.0release notes

Tooling 3

  • TestClient typing and warnings were adjusted.

    1.3.0release notes

  • The protocol parameter is annotated with Literal.

    1.3.0release notes

  • The test client now supports httpx2, allowing developers to use it with the test client.

    1.2.0release notes

Fixes and other changes 34

  • NaN and infinity are reported correctly; NaN was previously reported as a negative float.

    1.10.0release notes

  • Comparing FormData objects with several UploadFile values under the same key no longer raises TypeError.

    1.10.0release notes

  • The parser is finalized when the request stream is exhausted, preserving the last field when a custom stream does not yield a final empty chunk.

    1.10.0release notes

  • BaseHTTPMiddleware, GZipMiddleware, and SessionMiddleware default an omitted headers field to an empty list instead of raising KeyError.

    1.10.0release notes

  • root_path is stripped only at a path segment boundary, preventing paths such as /application from becoming /lication under /app.

    1.10.0release notes

  • Use the byte length for Content-Length when the response body is a typed or multidimensional memoryview.

    1.9.0release notes

  • Host routing matches host names case-insensitively.

    1.9.0release notes

  • Include HEAD in the Allow header of 405 responses when GET is defined.

    1.9.0release notes

  • Preserve every existing Vary header; this method is used by GZipMiddleware and SessionMiddleware.

    1.9.0release notes

  • Percent-encode \ and a leading // in url_path_for.

    1.9.0release notes

  • Stops transfers when the client disconnects.

    1.8.0release notes

  • Preserves response trailers when the middleware handles a response.

    1.8.0release notes

  • Stops a multipart range response when the file ends before a range is complete, instead of looping forever.

    1.8.0release notes

  • Ignores Range when If-Range contains a weak ETag.

    1.8.0release notes

  • Closes generators deterministically, avoiding "Exception ignored" errors with stacked BaseHTTPMiddleware.

    1.8.0release notes

  • Adds Vary: Cookie when removing an existing key.

    1.8.0release notes

  • Emits Max-Age=0 on the session cookie when max_age=0.

    1.8.0release notes

  • Includes Allow: GET, HEAD in 405 responses.

    1.8.0release notes

  • Brackets IPv6 hostnames in replacement URLs.

    1.8.0release notes

  • Normal CORS responses include Vary: Origin, and preflight responses vary by all request headers that affect them.

    1.7.0release notes

  • Configuration annotations accept Collection[str], including sets and frozensets.

    1.7.0release notes

  • Range headers are ignored when the response status is not 200, preserving its status and full body.

    1.7.0release notes

  • Malformed Host headers and IPv6 authorities are handled consistently across URL construction, host routing, and redirect middleware.

    1.7.0release notes

  • Adds support for Python 3.15.

    1.7.0release notes

  • Session mutations made with popitem() and |= are now persisted.

    1.7.0release notes

  • Handles a standalone If-None-Match: * header.

    1.7.0release notes

  • Rejects WebSocket requests without raising an assertion error.

    1.7.0release notes

  • Handles empty and absent payloads.

    1.7.0release notes

  • Inverted single-byte ranges such as bytes=5-4 are rejected.

    1.5.1release notes

  • Skips compression of partial responses.

    1.5.0release notes

  • Exception groups from user code are no longer collapsed.

    1.3.0release notes

  • Oversized suffix ranges are clamped, affecting how FileResponse handles range requests.

    1.3.0release notes

  • Closing temp files catches OSError alongside MultiPartException.

    1.3.0release notes

  • Fixes an IndexError when replacing a URL that has no authority.

    1.3.0release notes

starlette 0.522 changes

New APIs and options 1

  • State can now be accessed using dictionary-style syntax, with improved type safety.

    0.52.0release notes

Behavior and default changes 1

  • Starlette uses typing_extensions only on older Python versions.

    0.52.1release notes

starlette 0.512 changes

New APIs and options 1

Fixes and other changes 1

  • Increases the warning stacklevel for DeprecationWarning in the wsgi module.

    0.51.0release notes

starlette 0.501 changes

Breaking changes 1

starlette 0.498 changes

Security 1

New APIs and options 1

  • Adds an encoding parameter to the Config class.

    0.49.0release notes

Performance 1

Behavior and default changes 1

  • The Middleware type is less strict, allowing a wider range of middleware typing.

    0.49.3release notes

Fixes and other changes 4

  • StaticFiles now ignores the if-modified-since header when if-none-match is present.

    0.49.2release notes

  • Avoids polluting exception context in Middleware when using BaseHTTPMiddleware.

    0.49.0release notes

  • Request.cookies supports multiple cookie headers.

    0.49.0release notes

  • Encoding values for WebSocketEndpoint use the Literal type.

    0.49.0release notes