Skip to content
Browse files

Update lib/rack/directory.rb

Avoid SCRIPT_NAME escaping.

When it serve /, it works just well, cause SCRIPT_NAME is empty and there are nothing to escape.

However, when serving /some-url, the generated links will look like "%2Fsome-url/some-path".
  • Loading branch information...
1 parent ab67e70 commit 15a1738342ff79bbf5e6e38be9368374c8ba6042 slivu committed Jul 30, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/rack/directory.rb
View
2 lib/rack/directory.rb
@@ -80,7 +80,7 @@ def list_directory
@files = [['../','Parent Directory','','','']]
glob = F.join(@path, '*')
- url_head = ([@script_name] + @path_info.split('/')).map do |part|
+ url_head = [@script_name] + @path_info.split('/').map do |part|
Rack::Utils.escape part
end

0 comments on commit 15a1738

Please sign in to comment.
Something went wrong with that request. Please try again.