Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProxyHeadersMiddleware not using the X-Forwarded-Port header #1974

Open
fiannac opened this issue May 10, 2023 Discussed in #1948 · 3 comments
Open

ProxyHeadersMiddleware not using the X-Forwarded-Port header #1974

fiannac opened this issue May 10, 2023 Discussed in #1948 · 3 comments

Comments

@fiannac
Copy link

fiannac commented May 10, 2023

Discussed in #1948

Originally posted by fiannac April 21, 2023
From the documentation:
--proxy-headers / --no-proxy-headers Enable/Disable X-Forwarded-Proto, X-Forwarded-For, X-Forwarded-Port to populate remote address info.

But I've noticed that, when the flag is set, the X-Forwarded-Port is not actually used by the application, and the source port is always set to 0.
This has to do with how the `ProxyHeadersMiddleware' is implemented, which does not match the behavior described in the docs.

Important

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@Kludex Kludex closed this as completed May 10, 2023
@Kludex
Copy link
Member

Kludex commented May 10, 2023

The discussion is already created.

@Kludex Kludex reopened this Feb 29, 2024
victor-torres added a commit to victor-torres/uvicorn that referenced this issue Sep 30, 2024
@Kludex
Copy link
Member

Kludex commented Oct 9, 2024

Is there any server implementation that uses X-Forwarded-Port?

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

No branches or pull requests

3 participants