instance method
allow_request_origin?
Ruby on Rails 6.0.6
Since v5.2.8.1 PrivateSignature
allow_request_origin?()
No documentation comment.
Source
# File actioncable/lib/action_cable/connection/base.rb, line 199
def allow_request_origin?
return true if server.config.disable_request_forgery_protection
proto = Rack::Request.new(env).ssl? ? "https" : "http"
if server.config.allow_same_origin_as_host && env["HTTP_ORIGIN"] == "#{proto}://#{env['HTTP_HOST']}"
true
elsif Array(server.config.allowed_request_origins).any? { |allowed_origin| allowed_origin === env["HTTP_ORIGIN"] }
true
else
logger.error("Request origin not allowed: #{env['HTTP_ORIGIN']}")
false
end
end
Defined in actioncable/lib/action_cable/connection/base.rb line 199
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionCable::Connection::Base