diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-23 03:18:51 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-23 03:18:51 +0000 |
commit | e02eb253e7a31f4767eecd8d55a62e5a5608b74a (patch) | |
tree | d0402911b04cf1515a5eefab193c12e14be67bbd /lib/uri | |
parent | 66aba8cca29d250667ec0830cca77a9b021745cc (diff) | |
download | ruby-e02eb253e7a31f4767eecd8d55a62e5a5608b74a.tar.gz |
* lib/uri/generic.rb (check_port): allow strings for port= as
described in rdoc.
* lib/uri/rfc3986_parser.rb (regexp): implementation detail of above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/uri')
-rw-r--r-- | lib/uri/generic.rb | 2 | ||||
-rw-r--r-- | lib/uri/rfc3986_parser.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/uri/generic.rb b/lib/uri/generic.rb index b924f53cd7..7fbe5ff396 100644 --- a/lib/uri/generic.rb +++ b/lib/uri/generic.rb @@ -683,7 +683,7 @@ module URI "can not set port with registry or opaque" elsif !v.kind_of?(Fixnum) && parser.regexp[:PORT] !~ v raise InvalidComponentError, - "bad component(expected port component): #{v}" + "bad component(expected port component): #{v.inspect}" end return true diff --git a/lib/uri/rfc3986_parser.rb b/lib/uri/rfc3986_parser.rb index cd95ab8860..aa74e11eb4 100644 --- a/lib/uri/rfc3986_parser.rb +++ b/lib/uri/rfc3986_parser.rb @@ -84,7 +84,7 @@ module URI QUERY: /\A(?:%\h\h|[!$&-.0-;=@-Z_a-z~]|[\/?])*\z/, FRAGMENT: /\A(?:%\h\h|[!$&-.0-;=@-Z_a-z~]|[\/?])*\z/, OPAQUE: nil, - PORT: nil, + PORT: /\A[\x09\x0a\x0c\x0d ]*\d*[\x09\x0a\x0c\x0d ]*\z/, } end |