@@ -30,12 +30,30 @@ def test_doesnt_rewrite_dotcom_subdomain_image_urls
30
30
CamoFilter . call ( orig , @options ) . to_s
31
31
end
32
32
33
+ def test_doesnt_rewrite_dotcom_subsubdomain_image_urls
34
+ orig = %(<p><img src="https://f.assets.github.com/img.png"></p>)
35
+ assert_equal "<p><img src=\" https://f.assets.github.com/img.png\" ></p>" ,
36
+ CamoFilter . call ( orig , @options ) . to_s
37
+ end
38
+
39
+ def test_camouflaging_github_prefixed_image_urls
40
+ orig = %(<p><img src="https://notgithub.com/img.png"></p>)
41
+ assert_includes 'img src="' + @asset_proxy_url ,
42
+ CamoFilter . call ( orig , @options ) . to_s
43
+ end
44
+
33
45
def test_doesnt_rewrite_dotcom_app_image_urls
34
46
orig = %(<p><img src="https://githubapp.com/img.png"></p>)
35
47
assert_equal "<p><img src=\" https://githubapp.com/img.png\" ></p>" ,
36
48
CamoFilter . call ( orig , @options ) . to_s
37
49
end
38
50
51
+ def test_rewrite_dotcom_app_image_urls
52
+ orig = %(<p><img src="https://githubapp.com/img.png"></p>)
53
+ assert_equal "<p><img src=\" https://githubapp.com/img.png\" ></p>" ,
54
+ CamoFilter . call ( orig , @options ) . to_s
55
+ end
56
+
39
57
def test_doesnt_rewrite_absolute_image_urls
40
58
orig = %(<p><img src="/img.png"></p>)
41
59
assert_equal "<p><img src=\" /img.png\" ></p>" ,
@@ -48,7 +66,6 @@ def test_doesnt_rewrite_relative_image_urls
48
66
CamoFilter . call ( orig , @options ) . to_s
49
67
end
50
68
51
-
52
69
def test_camouflaging_https_image_urls
53
70
orig = %(<p><img src="https://foo.com/img.png"></p>)
54
71
assert_includes 'img src="' + @asset_proxy_url ,
0 commit comments