Commit e457003
authored
Move the host request parsing to a separate method. (#85)
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.1 parent d42c291 commit e457003
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
491 | 491 | | |
492 | 492 | | |
493 | 493 | | |
494 | | - | |
495 | | - | |
| 494 | + | |
496 | 495 | | |
497 | 496 | | |
498 | 497 | | |
| |||
504 | 503 | | |
505 | 504 | | |
506 | 505 | | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
507 | 511 | | |
508 | 512 | | |
509 | 513 | | |
| |||
0 commit comments