diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-01 16:00:46 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-01 16:00:46 +0000 |
commit | 7aab2aad6e1858788a6b844298db5bd7465a0e73 (patch) | |
tree | d42fea86e9d21e5dbd164378145153cb661a22a3 /lib/uri/common.rb | |
parent | b7b82c25641dd52727368e21b8c4e348f0e787d8 (diff) | |
download | ruby-7aab2aad6e1858788a6b844298db5bd7465a0e73.tar.gz |
* lib/uri/common.rb (initialize_regexp): allow leading
and trailing white space, and forbid extra characters
on another lines. [ruby-core:26223]
RFC 3986 Appendix C. Delimiting a URI in Context
draft-duerst-iri-bis-07 7.2. Web Address processing
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/uri/common.rb')
-rw-r--r-- | lib/uri/common.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/uri/common.rb b/lib/uri/common.rb index 9f849c03a4..8958c79047 100644 --- a/lib/uri/common.rb +++ b/lib/uri/common.rb @@ -397,8 +397,8 @@ module URI ret = {} # for URI::split - ret[:ABS_URI] = Regexp.new('^' + pattern[:X_ABS_URI] + '$', Regexp::EXTENDED) - ret[:REL_URI] = Regexp.new('^' + pattern[:X_REL_URI] + '$', Regexp::EXTENDED) + ret[:ABS_URI] = Regexp.new('\A\s*' + pattern[:X_ABS_URI] + '\s*\z', Regexp::EXTENDED) + ret[:REL_URI] = Regexp.new('\A\s*' + pattern[:X_REL_URI] + '\s*\z', Regexp::EXTENDED) # for URI::extract ret[:URI_REF] = Regexp.new(pattern[:URI_REF]) |