Permalink
Browse files

Merge pull request #40 from mvj3/master

Fix Rack::AcceptFormat can't handler url which end with slash, and that will raise 406
  • Loading branch information...
2 parents 551ae79 + a4fabcb commit f003cb04dd49c78ad1c4d8c8a23756a86f8d27e6 @rkh rkh committed Dec 10, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/rack/contrib/accept_format.rb
@@ -37,7 +37,7 @@ def call(env)
if ::File.extname(req.path_info).empty?
accept = env['HTTP_ACCEPT'].to_s.scan(/[^;,\s]*\/[^;,\s]*/)[0].to_s
extension = Rack::Mime::MIME_TYPES.invert[accept] || @ext
- req.path_info = req.path_info+"#{extension}"
+ req.path_info = req.path_info.chomp('/') << "#{extension}"
end
@app.call(env)

0 comments on commit f003cb0

Please sign in to comment.