From a50753268a9033dcdc57d6dee45f3829cdedf8f0 Mon Sep 17 00:00:00 2001 From: Marcelo Trylesinski Date: Fri, 27 Sep 2024 21:53:44 +0200 Subject: [PATCH] Version 0.31.0 (#2469) --- CHANGELOG.md | 12 ++++++++++++ docs/deployment.md | 4 ++-- uvicorn/__init__.py | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a555b6a3..79f8cb6ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Change Log +## 0.31.0 (2024-09-27) + +### Added + +Improve `ProxyHeadersMiddleware` (#2468) and (#2231): + +- Fix the host for requests from clients running on the proxy server itself. +- Fallback to host that was already set for empty x-forwarded-for headers. +- Also allow to specify IP Networks as trusted hosts. This greatly simplifies deployments + on docker swarm/kubernetes, where the reverse proxy might have a dynamic IP. + - This includes support for IPv6 Address/Networks. + ## 0.30.6 (2024-08-13) ### Fixed diff --git a/docs/deployment.md b/docs/deployment.md index 5b1cf6272..e1854deff 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -385,7 +385,8 @@ For more information, check [`ProxyHeadersMiddleware`](https://github.com/encode ### Client Port -Currently if the `ProxyHeadersMiddleware` is able to retrieve a trusted client value then the client's port will be set to `0`. This is because port information is lost when using these headers. +Currently if the `ProxyHeadersMiddleware` is able to retrieve a trusted client value then the client's port will be set to `0`. +This is because port information is lost when using these headers. ### UNIX Domain Sockets (UDS) @@ -396,7 +397,6 @@ For example: - when NGINX itself is running behind a UDS it will add the literal `unix:` as the client in the `X-Forwarded-For` header. - When Uvicorn is running behind a UDS the initial client will be `None`. - ### Trust Everything Rather than specifying what to trust, you can instruct Uvicorn to trust all clients using the literal `"*"`. diff --git a/uvicorn/__init__.py b/uvicorn/__init__.py index da9d23b64..f14403d1d 100644 --- a/uvicorn/__init__.py +++ b/uvicorn/__init__.py @@ -1,5 +1,5 @@ from uvicorn.config import Config from uvicorn.main import Server, main, run -__version__ = "0.30.6" +__version__ = "0.31.0" __all__ = ["main", "run", "Config", "Server"]