Permalink
Browse files

/ is allowed in URI fragments

  • Loading branch information...
jeremy committed Oct 14, 2011
1 parent ec37160 commit bceec4c3c3c8bb8d0747e0c58fd539f46228c37b
Showing with 3 additions and 3 deletions.
  1. +1 −1 actionpack/lib/action_dispatch/http/url.rb
  2. +2 −2 actionpack/test/controller/url_rewriter_test.rb
@@ -45,7 +45,7 @@ def url_for(options = {})
rewritten_url << (options[:trailing_slash] ? path.sub(/\?|\z/) { "/" + $& } : path)
rewritten_url << "?#{params.to_query}" unless params.empty?
- rewritten_url << "##{Journey::Router::Utils.escape_uri(options[:anchor].to_param.to_s)}" if options[:anchor]
+ rewritten_url << "##{Journey::Router::Utils.escape_fragment(options[:anchor].to_param.to_s)}" if options[:anchor]
rewritten_url
end
@@ -70,9 +70,9 @@ def test_anchor_should_call_to_param
)
end
- def test_anchor_should_be_cgi_escaped
+ def test_anchor_should_be_uri_escaped
assert_equal(
- 'http://test.host/c/a/i#anc%2Fhor',
+ 'http://test.host/c/a/i#anc/hor',
@rewriter.rewrite(@routes, :controller => 'c', :action => 'a', :id => 'i', :anchor => Struct.new(:to_param).new('anc/hor'))
)
end

0 comments on commit bceec4c

Please sign in to comment.