Project

General

Profile

Actions

Bug #2374

closed

URI.regexp('http') が 'http://' にマッチする

Added by kyanagi (Kouhei Yanagita) over 14 years ago. Updated almost 13 years ago.

Status:
Rejected
Target version:
ruby -v:
ruby 1.9.2dev (2009-11-16 trunk 25792) [i686-linux]
Backport:

Description

=begin
URI.regexp('http') が 'http://' にマッチしますが、'http://' は有効な URI ではありません。

% ~/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.

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0