Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix asset file paths with dangling queries in mtime check

  • Loading branch information...
commit f1f4e84a7ef88d941f6508673bb448de640d6f77 1 parent 8cb14ee
@jeremy jeremy authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 actionpack/lib/action_view/helpers/asset_tag_helper.rb
View
8 actionpack/lib/action_view/helpers/asset_tag_helper.rb
@@ -612,7 +612,7 @@ def determine_source(source, collection)
end
def join_asset_file_contents(paths)
- paths.collect { |path| File.read(File.join(ASSETS_DIR, path.split("?").first)) }.join("\n\n")
+ paths.collect { |path| File.read(asset_file_path(path)) }.join("\n\n")
end
def write_asset_file_contents(joined_asset_path, asset_paths)
@@ -621,10 +621,14 @@ def write_asset_file_contents(joined_asset_path, asset_paths)
# Set mtime to the latest of the combined files to allow for
# consistent ETag without a shared filesystem.
- mt = asset_paths.map { |p| File.mtime(File.join(ASSETS_DIR, p)) }.max
+ mt = asset_paths.map { |p| File.mtime(asset_file_path(p)) }.max
File.utime(mt, mt, joined_asset_path)
end
+ def asset_file_path(path)
+ File.join(ASSETS_DIR, path.split('?').first)
+ end
+
def collect_asset_files(*path)
dir = path.first
Please sign in to comment.
Something went wrong with that request. Please try again.