@@ -14,7 +14,7 @@ class Pipeline
14
14
# Context options:
15
15
# :asset_proxy (required) - Base URL for constructed asset proxy URLs.
16
16
# :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
18
18
# src rewriting.
19
19
#
20
20
# This filter does not write additional information to the context.
@@ -33,8 +33,8 @@ def call
33
33
next
34
34
end
35
35
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 )
38
38
39
39
element [ 'src' ] = asset_proxy_url ( uri . to_s )
40
40
element [ 'data-canonical-src' ] = uri . to_s
@@ -64,7 +64,7 @@ def asset_proxy_enabled?
64
64
!context [ :disable_asset_proxy ]
65
65
end
66
66
67
- # Private: the hostname to use for generated asset proxied URLs.
67
+ # Private: the host to use for generated asset proxied URLs.
68
68
def asset_proxy_host
69
69
context [ :asset_proxy ]
70
70
end
@@ -77,9 +77,9 @@ def asset_proxy_whitelist
77
77
context [ :asset_proxy_whitelist ] || [ ]
78
78
end
79
79
80
- def asset_hostname_whitelisted? ( hostname )
80
+ def asset_host_whitelisted? ( host )
81
81
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 )
83
83
end
84
84
end
85
85
0 commit comments