I have a Sinatra route like
get 'check/:input' do |in|
##Do stuff in here
end
but when I put a string in :input that contains a forward slash, such as "abcde/12345" or even encoded like "abcde%2F12345", Sinatra is thinking I am trying to reach
check/abcde/12345
and I hit the standard Sinatra 404 page. How do I get around this? I need the slash in the input variable, so I can't simply trim it out or anything like that. Any help would be greatly appreciated!!
This is done deliberately as part of rack-protection’s path traversal protection.
To disable it you can do
set :protection, :except => :path_traversal
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With