summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/uri.rb2
-rw-r--r--lib/uri/generic.rb14
2 files changed, 14 insertions, 2 deletions
diff --git a/lib/uri.rb b/lib/uri.rb
index 1832fb8d5d..d33f0c827f 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 1510e53eeb..e80c6f752b 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