Skip to content

Commit ac79750

Browse files
committed
Merge branch 'master' into travis
2 parents 430cdca + 8b00aac commit ac79750

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/html/pipeline/camo_filter.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Pipeline
1414
# Context options:
1515
# :asset_proxy (required) - Base URL for constructed asset proxy URLs.
1616
# :asset_proxy_secret_key (required) - The shared secret used to encode URLs.
17-
# :asset_proxy_whitelist - Array of hostname Strings or Regexps to skip
17+
# :asset_proxy_whitelist - Array of host Strings or Regexps to skip
1818
# src rewriting.
1919
#
2020
# This filter does not write additional information to the context.
@@ -33,8 +33,8 @@ def call
3333
next
3434
end
3535

36-
next if uri.hostname.nil?
37-
next if asset_hostname_whitelisted?(uri.hostname)
36+
next if uri.host.nil?
37+
next if asset_host_whitelisted?(uri.host)
3838

3939
element['src'] = asset_proxy_url(uri.to_s)
4040
element['data-canonical-src'] = uri.to_s
@@ -64,7 +64,7 @@ def asset_proxy_enabled?
6464
!context[:disable_asset_proxy]
6565
end
6666

67-
# Private: the hostname to use for generated asset proxied URLs.
67+
# Private: the host to use for generated asset proxied URLs.
6868
def asset_proxy_host
6969
context[:asset_proxy]
7070
end
@@ -77,9 +77,9 @@ def asset_proxy_whitelist
7777
context[:asset_proxy_whitelist] || []
7878
end
7979

80-
def asset_hostname_whitelisted?(hostname)
80+
def asset_host_whitelisted?(host)
8181
asset_proxy_whitelist.any? do |test|
82-
test.is_a?(String) ? hostname == test : test.match(hostname)
82+
test.is_a?(String) ? host == test : test.match(host)
8383
end
8484
end
8585

0 commit comments

Comments
 (0)