diff options
| author | akira <akira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-02-26 02:36:05 +0000 |
|---|---|---|
| committer | akira <akira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-02-26 02:36:05 +0000 |
| commit | 9848de50122f4fb60a1e64433a11defc2e7f7a7b (patch) | |
| tree | 4096de948345fc6b3dd2d0aac41e92a07e4b5eec | |
| parent | 5302f60bd92db7db6725a9beec67801deed05604 (diff) | |
| download | ruby-9848de50122f4fb60a1e64433a11defc2e7f7a7b.tar.gz ruby-9848de50122f4fb60a1e64433a11defc2e7f7a7b.tar.xz ruby-9848de50122f4fb60a1e64433a11defc2e7f7a7b.zip | |
* lib/uri/generic.rb: merge0 shuld return [oth, oth] if oth is absolute URI.
* lib/uri/generic.rb: registry part must not be allowed for any schemes for the Internet. (RFC2396, section 3.2.2 and 3.2.1.)
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 8 | ||||
| -rw-r--r-- | lib/uri.rb | 2 | ||||
| -rw-r--r-- | lib/uri/generic.rb | 14 |
3 files changed, 22 insertions, 2 deletions
@@ -1,3 +1,11 @@ +Tue Feb 26 11:25:50 2002 akira yamada <akira@arika.org> + + * lib/uri/generic.rb: merge0 shuld return [oth, oth] if oth is + absolute URI. + + * lib/uri/generic.rb: registry part must not be allowed for any + schemes for the Internet. (RFC2396, section 3.2.2 and 3.2.1.) + Mon Feb 25 21:22:41 2002 Akinori MUSHA <knu@iDaemons.org> * ext/syslog/syslog.c: Merge from rough. Use SafeStringValue(). diff --git a/lib/uri.rb b/lib/uri.rb index 1832fb8d5..d33f0c827 100644 --- a/lib/uri.rb +++ b/lib/uri.rb @@ -15,7 +15,7 @@ =end module URI - VERSION_CODE = '000905'.freeze + VERSION_CODE = '000906'.freeze VERSION = VERSION_CODE.scan(/../).collect{|n| n.to_i}.join('.').freeze end diff --git a/lib/uri/generic.rb b/lib/uri/generic.rb index 1510e53ee..e80c6f752 100644 --- a/lib/uri/generic.rb +++ b/lib/uri/generic.rb @@ -55,6 +55,15 @@ Object end =begin +--- URI::Generic::use_registry +=end + USE_REGISTRY = false + + def self.use_registry + self::USE_REGISTRY + end + +=begin --- URI::Generic::build2 At first, try to create a new URI::Generic object using @@ -157,6 +166,9 @@ Object self.set_registry(registry) self.set_fragment(fragment) end + if @registry && !self.class.use_registry + raise InvalidURIError, "the scheme #{@scheme} does not accept registry part: #{@registry} (or bad hostname?)" + end @scheme.freeze if @scheme self.set_path('') if !@path && !@opaque # (see RFC2396 Section 5.2) @@ -803,7 +815,7 @@ Object if self.absolute? return self.dup, oth else - return oth.dup, self + return oth, oth end end private :merge0 |
