This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Process favicon for cdn_helpers

  • Loading branch information...
jystewart committed May 7, 2011
1 parent 97bfea5 commit 4e1c630d97f1e7c6c4b19e5b7aee93a258c8bd2d
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/cdn_helpers.rb
View
@@ -67,6 +67,11 @@ def self.process_document(html, file_path, public_root_path, asset_hosts, logger
elem['src'] = asset_hosts.sample + process_asset_url(elem['src'], file_path, public_root_path, logger)
end
end
+ html.search('link[rel="shortcut icon"]').each do |elem|
+ if URI.parse(elem['href']).scheme.nil?
+ elem['href'] = asset_hosts.sample + process_asset_url(elem['href'], file_path, public_root_path, logger)
+ end
+ end
html
end

0 comments on commit 4e1c630

Please sign in to comment.