We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2550387 commit e0cf905Copy full SHA for e0cf905
lib/html/pipeline/camo_filter.rb
@@ -37,6 +37,7 @@ def call
37
next if asset_hostname_whitelisted?(uri.hostname)
38
39
element['src'] = asset_proxy_url(uri.to_s)
40
+ element['data-canonical-src'] = uri.to_s
41
end
42
doc
43
test/html/pipeline/camo_filter_test.rb
@@ -17,6 +17,8 @@ def test_camouflaging_http_image_urls
17
orig = %(<p><img src="http://twitter.com/img.png"></p>)
18
assert_includes 'img src="' + @asset_proxy_url,
19
CamoFilter.call(orig, @options).to_s
20
+ assert_includes 'data-canonical-src="http://twitter.com/img.png"',
21
+ CamoFilter.call(orig, @options).to_s
22
23
24
def test_doesnt_rewrite_dotcom_image_urls
0 commit comments