diff options
-rw-r--r-- | actionpack/CHANGELOG | 2 | ||||
-rw-r--r-- | actionpack/lib/action_view/helpers/asset_tag_helper.rb | 25 |
2 files changed, 16 insertions, 11 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index cec593a6a0..21cc7a9c64 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -1,5 +1,7 @@ *Edge* +* 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] + * Removed config.action_view.cache_template_loading, use config.cache_classes instead [Josh Peek] * Get buffer for fragment cache from template's @output_buffer [Josh Peek] diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionpack/lib/action_view/helpers/asset_tag_helper.rb index bf13945844..ac71f83336 100644 --- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb @@ -503,21 +503,24 @@ module ActionView 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, |