mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@2138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6e2ad002ed
commit
3916df613e
3 changed files with 22 additions and 2 deletions
|
@ -54,6 +54,15 @@ Object
|
|||
self::COMPONENT
|
||||
end
|
||||
|
||||
=begin
|
||||
--- URI::Generic::use_registry
|
||||
=end
|
||||
USE_REGISTRY = false
|
||||
|
||||
def self.use_registry
|
||||
self::USE_REGISTRY
|
||||
end
|
||||
|
||||
=begin
|
||||
|
||||
--- URI::Generic::build2
|
||||
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue