Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #9562 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

Optimized routes should not escape slashes for PathSegment

Reported by: wildchild Assigned to: core
Priority: normal Milestone: 1.2.4
Component: ActionPack Version: edge
Severity: normal Keywords:
Cc:

Description

In case when routing optimization is used following test case fails:

  def test_paths_slashes_unescaped_with_ordered_parameters
    rs.add_named_route :path, '/file/*path', :controller => 'content' 

    # No / to %2F in URI, only for query params. 
    x = setup_for_named_route 
    assert_equal("/file/hello/world", x.send(:path_path, 'hello/world'))
  end

Attachments

test_paths_slashes_unescaped_with_ordered_parameters.diff (0.7 kB) - added by wildchild on 09/15/07 12:16:31.
Test to demonstrate issue
paths_slashes_unescaped_with_ordered_parameters.diff (1.6 kB) - added by wildchild on 09/15/07 13:03:40.
Test and fix included

Change History

09/15/07 12:16:31 changed by wildchild

  • attachment test_paths_slashes_unescaped_with_ordered_parameters.diff added.

Test to demonstrate issue

09/15/07 13:02:32 changed by wildchild

PathSegment should be escaped by using PathSegment.UNSAFE_PCHAR regexp. Tests pass.

09/15/07 13:03:40 changed by wildchild

  • attachment paths_slashes_unescaped_with_ordered_parameters.diff added.

Test and fix included

09/15/07 22:10:23 changed by bitsweat

  • status changed from new to closed.
  • resolution set to fixed.

(In [7487]) Fixed optimized route segment escaping. Closes #9562.