From 8588e7631eeab7fe8b91d2f2f7059144b233ad0d Mon Sep 17 00:00:00 2001 From: mame Date: Thu, 15 Apr 2010 13:41:19 +0000 Subject: * lib/uri/ftp.rb (URI::FTP#set_path): added to correct handling of special case where path of ftp is relative. This converts relative path to absolute one, because external representation of ftp path is relative and internal representation is absolute. [ruby-core:24077] * lib/uri/ftp.rb (URI::FTP#initialize): converts absolute to relative. * lib/uri/generic.rb (URI::Generic#check_path): allow relative path when scheme is ftp. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/uri/generic.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/uri/generic.rb') diff --git a/lib/uri/generic.rb b/lib/uri/generic.rb index 14ca97301b..4fdfd140fe 100644 --- a/lib/uri/generic.rb +++ b/lib/uri/generic.rb @@ -482,7 +482,9 @@ module URI "path conflicts with opaque" end - if @scheme + # If scheme is ftp, path may be relative. + # See RFC 1738 section 3.2.2, and RFC 2396. + if @scheme && @scheme != "ftp" if v && v != '' && parser.regexp[:ABS_PATH] !~ v raise InvalidComponentError, "bad component(expected absolute path component): #{v}" -- cgit v1.2.3