diff options
-rw-r--r-- | lib/uri/generic.rb | 41 |
1 files changed, 10 insertions, 31 deletions
@@ -1096,16 +1096,20 @@ module URI # # => #<URI::HTTP:0x2021f3b0 URL:http://my.example.com/main.rbx?page=1> # def merge(oth) - begin - base, rel = merge0(oth) - rescue - raise $!.class, $!.message end - if base == rel - return base end authority = rel.userinfo || rel.host || rel.port # RFC2396, Section 5.2, 2) @@ -1136,31 +1140,6 @@ module URI end # merge alias + merge - # return base and rel. - # you can modify `base', but can not `rel'. - def merge0(oth) - oth = parser.send(:convert_to_uri, oth) - - if self.relative? && oth.relative? - raise BadURIError, - "both URI are relative" - end - - if self.absolute? && oth.absolute? - #raise BadURIError, - # "both URI are absolute" - # hmm... should return oth for usability? - return oth, oth - end - - if self.absolute? - return self.dup, oth - else - return oth, oth - end - end - private :merge0 - # :stopdoc: def route_from_path(src, dst) case dst |