[Bug #2374] URI.regexp('http') $B$,(B 'http://' $B$K%^%C%A$9$k(B

Bug #2374: URI.regexp(‘http’) e$B$,e(B ‘http://’ e$B$K%^%C%A$9$ke(B
http://redmine.ruby-lang.org/issues/show/2374

e$B5/I<<Te(B: Kouhei Y.
e$B%9%F!<%?%9e(B: Open, e$BM%@hEYe(B: Normal
e$B%+%F%4%je(B: lib
ruby -v: ruby 1.9.2dev (2009-11-16 trunk 25792) [i686-linux]

URI.regexp(‘http’) e$B$,e(B ‘http://’ e$B$K%^%C%A$7$^$9$,!“e(B’http://’
e$B$OM-8z$Je(B URI e$B$G$O$”$j$^$;$s!#e(B

% ~/local/ruby-trunk/bin/ruby -v -ruri -e ‘URI.regexp =~ “http://”; p
$&’
ruby 1.9.2dev (2009-11-16 trunk 25792) [i686-linux]
“http://”

http://www.ietf.org/rfc/rfc3986 [Page 20]

If the URI scheme defines a default for host, then that default
applies when the host subcomponent is undefined or when the
registered name is empty (zero length). For example, the “file” URI
scheme is defined so that no authority, an empty host, and
“localhost” all mean the end-user’s machine, whereas the “http”
scheme considers a missing authority or empty host invalid.