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

Rework host/hostname/authority implementation. #1561

Merged
merged 11 commits into from Feb 7, 2020
Merged

Commits on Feb 6, 2020

  1. Add specs to better match implementation of URI.host and `URI.hostn…

    …ame`.
    
      u = URI("http://[::1]/bar")
      p u.hostname      #=> "::1"
      p u.host          #=> "[::1]"
    ioquatix committed Feb 6, 2020
    Copy the full SHA
    488dae7 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    26e4d7c View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    b9b87a7 View commit details
    Browse the repository at this point in the history
  4. Improve Rack::Request#authority and related methods.

    With IPv6, any time we have a string which represents an authority, as
    defined by RFC7540, the address must be contained within square brackets,
    e.g.: "[2020::1985]:443". Representations from the `host` header and
    `authority` pseudo-header must conform to this format.
    
    Some headers, notably `x-forwarded-for` and `x-forwarded-host` do not
    format the authority correctly. So we introduce a private method
    `wrap_ipv6` which uses a heuristic to detect these situations and fix the
    formatting.
    
    Additionally, we introduce some new assertions in `Rack::Lint` to ensure
    SREVER_NAME and HTTP_HOST match the formatting requirements.
    ioquatix committed Feb 6, 2020
    Copy the full SHA
    7e899c8 View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    66ea112 View commit details
    Browse the repository at this point in the history
  6. Add entry to CHANGELOG.

    ioquatix committed Feb 6, 2020
    Copy the full SHA
    aa68f07 View commit details
    Browse the repository at this point in the history

Commits on Feb 7, 2020

  1. Copy the full SHA
    dc44973 View commit details
    Browse the repository at this point in the history
  2. Prefer implicit returns.

    ioquatix committed Feb 7, 2020
    Copy the full SHA
    a146b6a View commit details
    Browse the repository at this point in the history
  3. Document AUTHORITY regexp.

    ioquatix committed Feb 7, 2020
    Copy the full SHA
    eb7de84 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    eec2635 View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    05212cd View commit details
    Browse the repository at this point in the history