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

Fix reference to URI::REGEXP::PATTERN::HOST #144

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/webrick/httprequest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -522,9 +522,10 @@ def parse_uri(str, scheme="http")
return URI::parse(uri.to_s)
end

host_pattern = URI::RFC2396_Parser.new.pattern.fetch(:HOST)
HOST_PATTERN = /\A(#{host_pattern})(?::(\d+))?\z/n
def parse_host_request_line(host)
pattern = /\A(#{URI::REGEXP::PATTERN::HOST})(?::(\d+))?\z/no
host.scan(pattern)[0]
host.scan(HOST_PATTERN)[0]
end

def read_body(socket, block)
Expand Down