Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Releases: Kludex/starlette

Version 0.52.1

18 Jan 13:33
e5b8a5d

Choose a tag to compare

What's Changed

  • Only use typing_extensions in older Python versions by @Kludex in #3109

Full Changelog: 0.52.0...0.52.1

Version 0.52.0

18 Jan 10:06
f490b42

Choose a tag to compare

In this release, State can be accessed using dictionary-style syntax for improved type safety (#3036).

from collections.abc import AsyncIterator
from contextlib import asynccontextmanager
from typing import TypedDict

import httpx

from starlette.applications import Starlette
from starlette.requests import Request


class State(TypedDict):
    http_client: httpx.AsyncClient


@asynccontextmanager
async def lifespan(app: Starlette) -> AsyncIterator[State]:
    async with httpx.AsyncClient() as client:
        yield {"http_client": client}


async def homepage(request: Request[State]):
    client = request.state["http_client"]
    # If you run the below line with mypy or pyright, it will reveal the correct type.
    reveal_type(client)  # Revealed type is 'httpx.AsyncClient'

See Accessing State for more details.


Full Changelog: 0.51.0...0.52.0

Version 0.51.0

10 Jan 20:22
df2ee22

Choose a tag to compare

Added

  • Add allow_private_network in CORSMiddleware #3065.

Changed

  • Increase warning stacklevel on DeprecationWarning for wsgi module #3082.

New Contributors

Full Changelog: 0.50.0...0.51.0

Version 0.50.0

01 Nov 15:24
4941b4a

Choose a tag to compare

Removed

  • Drop Python 3.9 support #3061.

Full Changelog: 0.49.3...0.50.0

Version 0.49.3

01 Nov 15:11
de3ffec

Choose a tag to compare

Fixed

  • Relax strictness on Middleware type #3059.

Full Changelog: 0.49.2...0.49.3

Version 0.49.2

01 Nov 11:38
85bf027

Choose a tag to compare

Fixed

  • Ignore if-modified-since header if if-none-match is present in StaticFiles #3044.

Full Changelog: 0.49.1...0.49.2

Version 0.49.1

28 Oct 17:33
7e4b742

Choose a tag to compare

This release fixes a security vulnerability in the parsing logic of the Range header in FileResponse.

You can view the full security advisory: GHSA-7f5h-v6xp-fcq8

Fixed


Full Changelog: 0.49.0...0.49.1

Version 0.49.0

28 Oct 08:10
7d88ea6

Choose a tag to compare

Added

  • Add encoding parameter to Config class #2996.
  • Support multiple cookie headers in Request.cookies #3029.
  • Use Literal type for WebSocketEndpoint encoding values #3027.

Changed

  • Do not pollute exception context in Middleware when using BaseHTTPMiddleware #2976.

New Contributors

Full Changelog: 0.48.0...0.49.0

Version 0.48.0

13 Sep 08:40
e18637c

Choose a tag to compare

Added

  • Add official Python 3.14 support #3013.

Changed


New Contributors

Full Changelog: 0.47.3...0.48.0

Version 0.47.3

24 Aug 07:08
cb8f84f

Choose a tag to compare

Fixed

  • Use asyncio.iscoroutinefunction for Python 3.12 and older by @mjpieters in #2984

New Contributors

Full Changelog: 0.47.2...0.47.3