This project is archived and is in readonly mode.
Routing: double escape url segments
-
edbond
- Assigned user changed from Yehuda Katz (wycats) to josh
-
josh
- State changed from new to open
- Milestone cleared.
-
Repository
- State changed from open to resolved
(from [61c471eebb3718a3ef5741e1e4d0974be7483290]) Add % to RESERVED_PCHAR [#2574 Routing: double escape url segments state:resolved]
Signed-off-by: Joshua Peek josh@joshpeek.com
http://github.com/rails/rails/commit/61c471eebb3718a3ef5741e1e4d097... -
Dan Byström
I suspecting that the routing string (/Карта--:title--:id) shouldn't be escaped. It makes sense to think that the rails developers escapes the route stings for us.
map.city URI.escape("/Карта--:title--:id"), ... it should be
map.city "/Карта--:title--:id", ... The unescaped code works just fine when I host/run my application with Apache+Phusion Passenger. However, in my development environment (Aptana Studio or the script/server command) then I have to escape all my routes and apply your routing_uri_escape.patch.Since I'm a newbe I have no clue what causes this escape bug. Still, I'm quite sure that the escape bug needs a second check.
-
Dan Byström
I think this is how you want to solve this problem.
# config/routes.rb map.city "/Карта--:title--:id", :controller => 'foo', :action => 'bar'# config/initializers/new_rails_defaults.rb module ActionController module Routing class RouteSet def recognize(request) params = recognize_path(URI.unescape(request.path), extract_request_environment(request)) request.path_parameters = params.with_indifferent_access "#{params[:controller].to_s.camelize}Controller".constantize end end end end
