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 underscore in host names for Rack 2.2 (Fixes #2070) #2071

Merged
merged 1 commit into from Apr 24, 2023

Conversation

jeremyevans
Copy link
Contributor

This makes Rack 2.2 behavior similar to Rack 2.1 and Rack 3.0 in regards to underscore in host names.

This makes Rack 2.2 behavior similar to Rack 2.1 and Rack 3.0 in
regards to underscore in host names.
Copy link
Member

@ioquatix ioquatix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems okay to me for consistency.

The current Rack 3 implementation for reference:

rack/lib/rack/request.rb

Lines 703 to 714 in f5666bc

AUTHORITY = /
\A
(?<host>
# Match IPv6 as a string of hex digits and colons in square brackets
\[(?<address>#{ipv6})\]
|
# Match any other printable string (except square brackets) as a hostname
(?<address>[[[:graph:]&&[^\[\]]]]*?)
)
(:(?<port>\d+))?
\z
/x

@ioquatix ioquatix merged commit e5a30bf into rack:2-2-stable Apr 24, 2023
8 checks passed
@ioquatix
Copy link
Member

@jeremyevans do we need to add tests to Rack main?

@jeremyevans
Copy link
Contributor Author

I think it would be a good idea.

@ioquatix
Copy link
Member

If you have time, can you make a follow-up PR.

bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Jun 2, 2023
https://build.opensuse.org/request/show/1090442
by user dancermak + dimstar_suse
- update to version 2.2.7

  * Correct the year number in the changelog (rack/rack#2015)
  * Support underscore in host names for Rack 2.2 (rack/rack#2071) (forwarded request 1084068 from krauselukas)
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.

None yet

2 participants