method
allows?
v7.0.0 -
Show latest stable
- Class:
ActionDispatch::HostAuthorization::Permissions
allows?(host)public
No documentation available.
# File actionpack/lib/action_dispatch/middleware/host_authorization.rb, line 39
def allows?(host)
@hosts.any? do |allowed|
if allowed.is_a?(IPAddr)
begin
allowed === extract_hostname(host)
rescue
# IPAddr#=== raises an error if you give it a hostname instead of
# IP. Treat similar errors as blocked access.
false
end
else
allowed === host
end
end
end