APIdock / Ruby on Rails
/
Browse About
method

local?

v7.1.3.2 - Show latest stable - Class: ActionDispatch::Request
local?()
public

True if the request came from localhost, 127.0.0.1, or ::1.

# File actionpack/lib/action_dispatch/http/request.rb, line 428
    def local?
      LOCALHOST.match?(remote_addr) && LOCALHOST.match?(remote_ip)
    end

Related methods

  • Instance methods
  • GET
  • POST
  • authorization
  • body
  • body_stream
  • commit_cookie_jar!
  • commit_csrf_token
  • commit_flash
  • content_length
  • controller_class
  • controller_class_for
  • controller_instance
  • controller_instance=
  • engine_script_name
  • engine_script_name=
  • form_data?
  • fullpath
  • headers
  • http_auth_salt
  • inspect
  • ip
  • key?
  • local?
  • logger
  • media_type
  • method
  • method_symbol
  • original_fullpath
  • original_url
  • query_parameters
  • raw_post
  • raw_request_method
  • remote_ip
  • remote_ip=
  • request_id
  • request_id=
  • request_method
  • request_method=
  • request_method_symbol
  • request_parameters
  • request_parameters=
  • reset_csrf_token
  • reset_session
  • route_uri_pattern
  • route_uri_pattern=
  • routes
  • routes=
  • send_early_hints
  • server_software
  • session=
  • session_options=
  • uuid
  • xhr?
  • xml_http_request?
  • Class methods
  • empty
  • new
  • Private methods
  • privatecheck_method
  • privatedefault_session
  • privateread_body_stream
APIdock API Documentation Browser

© 2026 APIdock