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

Move the host request parsing to a separate method. #85

Merged
merged 2 commits into from
Jan 26, 2023

Commits on Jan 16, 2022

  1. Move the host request parsing to a separate method.

    Allows for someone to override the parsing to accommodate "alternatives".
    One could write the following to allow underscores in host names.
    
    require 'webrick/httprequest'
    
    module WEBrick
      class HTTPRequest
        private
    
        def parse_host_request_line(host, scheme)
          uri = URI.parse("#{scheme}://#{host}")
          [uri.host, uri.port]
        end
      end
    end
    
    Also adding the "o" option to the regex so the regex is only built once.
    wishdev committed Jan 16, 2022
    Configuration menu
    Copy the full SHA
    ed12c2a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    21f4159 View commit details
    Browse the repository at this point in the history