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

Support RFC 7239 Forwarded header and configurable priorities for checking forwarding headers #1834

Merged
merged 3 commits into from Apr 5, 2022

Commits on Mar 17, 2022

  1. Support RFC 7239: HTTP Forwarded header

    Co-authored-by: Matt Bostock <matt@mattbostock.com>
    Co-authored-by: Jeremy Evans <code@jeremyevans.net>
    3 people committed Mar 17, 2022
    Configuration menu
    Copy the full SHA
    bbc6001 View commit details
    Browse the repository at this point in the history
  2. Allow configuring priorities for Forwarded and X-Forwarded-*

    The Request.forwarded_priority accessor sets the priority.  Default to
    considering Forwarded first, since it is now the official standard.
    
    Also allow configuring whether X-Forwarded-Proto or X-Forwarded-Scheme
    has priority, using the Request.x_forwarded_proto_priority
    accessor.
    
    Allowing configurable priorities for these headers is necessary,
    because which headers should be checked depends on the environment
    the application runs in.
    
    Make Request#forwarded_authority use the last forwarded authority
    instead of the first forwarded authority, since earlier forwarded
    authorities can be forged by the client.
    
    Fixes rack#1809
    Fixes rack#1829
    Implements rack#1423
    Implements rack#1832
    jeremyevans committed Mar 17, 2022
    Configuration menu
    Copy the full SHA
    e5cb98c View commit details
    Browse the repository at this point in the history

Commits on Mar 18, 2022

  1. Inline FORWARDED_PAIR_REGEX

    Only used in one place and no interpolation, there is no reason to
    use a constant in this case.
    jeremyevans committed Mar 18, 2022
    Configuration menu
    Copy the full SHA
    2b0ac05 View commit details
    Browse the repository at this point in the history