Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #5570 from avakhov/ac-caching-split

ActionController caching small String#split optimization
  • Loading branch information...
commit 64ccb59c9aba9e9f7186e2332927a911763869bf 2 parents 3756a3f + 6880489
@jeremy jeremy authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 actionpack/lib/action_controller/caching/actions.rb
View
4 actionpack/lib/action_controller/caching/actions.rb
@@ -170,14 +170,14 @@ def initialize(controller, options = {}, infer_extension = true)
options.reverse_merge!(:format => @extension) if options.is_a?(Hash)
end
- path = controller.url_for(options).split(%r{://}).last
+ path = controller.url_for(options).split('://', 2).last
@path = normalize!(path)
end
private
def normalize!(path)
path << 'index' if path[-1] == ?/
- path << ".#{extension}" if extension and !path.split('?').first.ends_with?(".#{extension}")
+ path << ".#{extension}" if extension and !path.split('?', 2).first.ends_with?(".#{extension}")
URI.parser.unescape(path)
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.