Skip to content

feat(proxy_headers): add support for x-forwarded-host#2811

Open
aberlioz wants to merge 1 commit intoKludex:mainfrom
aberlioz:feat/add-support-for-x-forwarded-host
Open

feat(proxy_headers): add support for x-forwarded-host#2811
aberlioz wants to merge 1 commit intoKludex:mainfrom
aberlioz:feat/add-support-for-x-forwarded-host

Conversation

@aberlioz
Copy link

@aberlioz aberlioz commented Feb 12, 2026

Summary

Fixes #965

Add support for X-Forwarded-Host header in uvicorn.

If a non-empty value is found for X-Forwarded-Host:

  • Updates scope["server"] with (host, port) values
  • Updates value of host header in scope["headers"]

Note

This is my first contribution to uvicorn, feedback is welcomed 🙏🏻

Checklist

  • I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.

@aberlioz aberlioz force-pushed the feat/add-support-for-x-forwarded-host branch 7 times, most recently from ae59e4c to 4b74020 Compare February 12, 2026 16:18
@aberlioz aberlioz marked this pull request as ready for review February 12, 2026 16:23
@aberlioz aberlioz force-pushed the feat/add-support-for-x-forwarded-host branch from 4b74020 to 6397cbc Compare February 12, 2026 16:34
@aberlioz aberlioz force-pushed the feat/add-support-for-x-forwarded-host branch from 6397cbc to 2f12f38 Compare February 16, 2026 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support X-Forwarded-Host in proxy-headers

1 participant