Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit f003cb04dd49c78ad1c4d8c8a23756a86f8d27e6 2 parents 551ae79 + a4fabcb
@rkh rkh authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/rack/contrib/accept_format.rb
View
2  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)
Please sign in to comment.
Something went wrong with that request. Please try again.