Module: Roda::RodaPlugins::UnescapePath
- Defined in:
- lib/roda/plugins/unescape_path.rb
Overview
The unescape_path plugin decodes a URL-encoded path before routing. This fixes routing when the slashes are URL-encoded as %2f and returns decoded parameters when matched by symbols or regexps.
plugin :unescape_path
route do |r|
# Assume /b/a URL encoded at %2f%62%2f%61
r.on :x, /(.)/ do |*x|
# x => ['b', 'a']
end
end
Defined Under Namespace
Modules: RequestMethods