method

authorized?

rails latest stable - Class: ActionDispatch::HostAuthorization

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v7.0.0) is shown here.

authorized?(request)
private

No documentation available.

# File actionpack/lib/action_dispatch/middleware/host_authorization.rb, line 144
      def authorized?(request)
        origin_host = request.get_header("HTTP_HOST")
        forwarded_host = request.x_forwarded_host&.split(/,\s?/)&.last

        @permissions.allows?(origin_host) && (forwarded_host.blank? || @permissions.allows?(forwarded_host))
      end