File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,9 @@ class CamoFilter < Filter
20
20
# Hijacks images in the markup provided, replacing them with URLs that
21
21
# go through the github asset proxy.
22
22
def call
23
+ return unless asset_proxy_enabled?
24
+
23
25
doc . search ( "img" ) . each do |element |
24
- next if context [ :disable_asset_proxy ]
25
26
next if element [ 'src' ] . nil?
26
27
27
28
begin
@@ -55,6 +56,11 @@ def asset_url_hash(url)
55
56
OpenSSL ::HMAC . hexdigest ( digest , asset_proxy_secret_key , url )
56
57
end
57
58
59
+ # Private: Return true if asset proxy filter should be enabled
60
+ def asset_proxy_enabled?
61
+ !context [ :disable_asset_proxy ]
62
+ end
63
+
58
64
# Private: the hostname to use for generated asset proxied URLs.
59
65
def asset_proxy_host
60
66
context [ :asset_proxy ]
You can’t perform that action at this time.
0 commit comments