aboutsummaryrefslogtreecommitdiffstats
path: root/lib/uri/generic.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/uri/generic.rb')
-rw-r--r--lib/uri/generic.rb4
1 files changed, 3 insertions, 1 deletions
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}"