Permalink
Browse files

Fixed that AssetTagHelper#compute_public_path shouldn't cache the ass…

…et_host along with the source or per-request proc's won't run [DHH]
  • Loading branch information...
1 parent 8c8399f commit 82e6e48af1634978156320a14cb520ca859725e3 @dhh dhh committed with tarmo Jul 16, 2008
Showing with 16 additions and 11 deletions.
  1. +2 −0 actionpack/CHANGELOG
  2. +14 −11 actionpack/lib/action_view/helpers/asset_tag_helper.rb
View
@@ -2,6 +2,8 @@
* Deprecate the limited follow_redirect in functional tests. If you wish to follow redirects, use integration tests. [Michael Koziarski]
+* Fixed that AssetTagHelper#compute_public_path shouldn't cache the asset_host along with the source or per-request proc's won't run [DHH]
+
* Deprecate define_javascript_functions, javascript_include_tag and friends are much better [Michael Koziarski]
* Fix polymorphic_url with singleton resources. #461 [Tammer Saleh]
@@ -485,21 +485,24 @@ def compute_public_path(source, dir, ext = nil, include_host = true)
source = "#{@controller.request.relative_url_root}#{source}"
end
end
- source = rewrite_asset_path(source)
- if include_host
- host = compute_asset_host(source)
+ rewrite_asset_path(source)
+ end
+ end
- if has_request && !host.blank? && host !~ %r{^[-a-z]+://}
- host = "#{@controller.request.protocol}#{host}"
- end
+ source = ActionView::Base.computed_public_paths[cache_key]
- "#{host}#{source}"
- else
- source
- end
- end
+ if include_host && source !~ %r{^[-a-z]+://}
+ host = compute_asset_host(source)
+
+ if has_request && !host.blank? && host !~ %r{^[-a-z]+://}
+ host = "#{@controller.request.protocol}#{host}"
end
+
+ "#{host}#{source}"
+ else
+ source
+ end
end
# Pick an asset host for this source. Returns +nil+ if no host is set,

0 comments on commit 82e6e48

Please sign in to comment.