summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/rack/utils.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/rack/utils.rb b/lib/rack/utils.rb
index 2e1e7971..1ecf2d1c 100644
--- a/lib/rack/utils.rb
+++ b/lib/rack/utils.rb
@@ -580,9 +580,9 @@ module Rack
part == '..' ? clean.pop : clean << part
end
- clean.unshift '/' if parts.empty? || parts.first.empty?
-
- ::File.join clean
+ clean_path = clean.join(::File::SEPARATOR)
+ clean_path.prepend("/") if parts.empty? || parts.first.empty?
+ clean_path
end
NULL_BYTE = "\0"