-
-
-
-
- Source:
-
-
-
-
-def any_authenticity_token_valid?
- request_authenticity_tokens.any? do |token|
- valid_authenticity_token?(session, token)
- end
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 448
+ def any_authenticity_token_valid? # :doc:
+ request_authenticity_tokens.any? do |token|
+ valid_authenticity_token?(session, token)
+ end
+ end
+
+ See on GitHub
+
+
+
+
@@ -449,22 +449,22 @@
-
-
-
-
- Source:
-
-
-
-
-def compare_with_global_token(token, session = nil)
- ActiveSupport::SecurityUtils.fixed_length_secure_compare(token, global_csrf_token(session))
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 534
+ def compare_with_global_token(token, session = nil) # :doc:
+ ActiveSupport::SecurityUtils.fixed_length_secure_compare(token, global_csrf_token(session))
+ end
+
+ See on GitHub
+
+
+
+
@@ -484,22 +484,22 @@
-
-
-
-
- Source:
-
-
-
-
-def compare_with_real_token(token, session = nil)
- ActiveSupport::SecurityUtils.fixed_length_secure_compare(token, real_csrf_token(session))
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 530
+ def compare_with_real_token(token, session = nil) # :doc:
+ ActiveSupport::SecurityUtils.fixed_length_secure_compare(token, real_csrf_token(session))
+ end
+
+ See on GitHub
+
+
+
+
@@ -519,26 +519,26 @@
-
-
-
-
- Source:
-
-
-
-
-def csrf_token_hmac(session, identifier)
- OpenSSL::HMAC.digest(
- OpenSSL::Digest::SHA256.new,
- real_csrf_token(session),
- identifier
- )
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 571
+ def csrf_token_hmac(session, identifier) # :doc:
+ OpenSSL::HMAC.digest(
+ OpenSSL::Digest::SHA256.new,
+ real_csrf_token(session),
+ identifier
+ )
+ end
+
+ See on GitHub
+
+
+
+
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 591
+ def form_authenticity_param # :doc:
+ params[request_forgery_protection_token]
+ end
+
+ See on GitHub
+
+
+
+
@@ -593,22 +593,22 @@
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 460
+ def form_authenticity_token(form_options: {}) # :doc:
+ masked_authenticity_token(form_options: form_options)
+ end
+
+ See on GitHub
+
+
+
+
@@ -628,22 +628,22 @@
-
-
-
-
- Source:
-
-
-
-
-def global_csrf_token(session = nil)
- csrf_token_hmac(session, GLOBAL_CSRF_TOKEN_IDENTIFIER)
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 567
+ def global_csrf_token(session = nil) # :doc:
+ csrf_token_hmac(session, GLOBAL_CSRF_TOKEN_IDENTIFIER)
+ end
+
+ See on GitHub
+
+
+
+
@@ -663,28 +663,28 @@
-
-
-
-
- Source:
-
-
-
-
-def handle_unverified_request
- protection_strategy = forgery_protection_strategy.new(self)
-
- if protection_strategy.respond_to?(:warning_message)
- protection_strategy.warning_message = unverified_request_warning_message
- end
-
- protection_strategy.handle_unverified_request
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 381
+ def handle_unverified_request # :doc:
+ protection_strategy = forgery_protection_strategy.new(self)
+
+ if protection_strategy.respond_to?(:warning_message)
+ protection_strategy.warning_message = unverified_request_warning_message
+ end
+
+ protection_strategy.handle_unverified_request
+ end
+
+ See on GitHub
+
+
+
+
@@ -704,22 +704,22 @@
-
-
-
-
- Source:
-
-
-
-
-def mark_for_same_origin_verification!
- @marked_for_same_origin_verification = request.get?
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 420
+ def mark_for_same_origin_verification! # :doc:
+ @marked_for_same_origin_verification = request.get?
+ end
+
+ See on GitHub
+
+
+
+
@@ -739,22 +739,22 @@
-
-
-
-
- Source:
-
-
-
-
-def marked_for_same_origin_verification?
- @marked_for_same_origin_verification ||= false
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 426
+ def marked_for_same_origin_verification? # :doc:
+ @marked_for_same_origin_verification ||= false
+ end
+
+ See on GitHub
+
+
+
+
@@ -774,25 +774,25 @@
-
-
-
-
- Source:
-
-
-
-
-def mask_token(raw_token)
- one_time_pad = SecureRandom.random_bytes(AUTHENTICITY_TOKEN_LENGTH)
- encrypted_csrf_token = xor_byte_strings(one_time_pad, raw_token)
- masked_token = one_time_pad + encrypted_csrf_token
- encode_csrf_token(masked_token)
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 523
+ def mask_token(raw_token) # :doc:
+ one_time_pad = SecureRandom.random_bytes(AUTHENTICITY_TOKEN_LENGTH)
+ encrypted_csrf_token = xor_byte_strings(one_time_pad, raw_token)
+ masked_token = one_time_pad + encrypted_csrf_token
+ encode_csrf_token(masked_token)
+ end
+
+ See on GitHub
+
+
+
+
@@ -812,22 +812,22 @@
-
-
-
-
- Source:
-
-
-
-
-def non_xhr_javascript_response?
- %r(\A(?:text|application)/javascript).match?(media_type) && !request.xhr?
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 431
+ def non_xhr_javascript_response? # :doc:
+ %r(\A(?:text|application)/javascript).match?(media_type) && !request.xhr?
+ end
+
+ See on GitHub
+
+
+
+
@@ -847,23 +847,23 @@
-
-
-
-
- Source:
-
-
-
-
-def normalize_action_path(action_path)
- uri = URI.parse(action_path)
- uri.path.chomp("/")
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 621
+ def normalize_action_path(action_path) # :doc:
+ uri = URI.parse(action_path)
+ uri.path.chomp("/")
+ end
+
+ See on GitHub
+
+
+
+
@@ -883,22 +883,22 @@
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 560
+ def per_form_csrf_token(session, action_path, method) # :doc:
+ csrf_token_hmac(session, [action_path, method.downcase].join("#"))
+ end
+
+ See on GitHub
+
+
+
+
@@ -918,22 +918,22 @@
-
-
-
-
- Source:
-
-
-
-
-def protect_against_forgery?
- allow_forgery_protection && (!session.respond_to?(:enabled?) || session.enabled?)
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 596
+ def protect_against_forgery? # :doc:
+ allow_forgery_protection && (!session.respond_to?(:enabled?) || session.enabled?)
+ end
+
+ See on GitHub
+
+
+
+
@@ -953,26 +953,26 @@
-
-
-
-
- Source:
-
-
-
-
-def real_csrf_token(_session = nil)
- csrf_token = request.env.fetch(CSRF_TOKEN) do
- request.env[CSRF_TOKEN] = csrf_token_storage_strategy.fetch(request) || generate_csrf_token
- end
-
- decode_csrf_token(csrf_token)
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 552
+ def real_csrf_token(_session = nil) # :doc:
+ csrf_token = request.env.fetch(CSRF_TOKEN) do
+ request.env[CSRF_TOKEN] = csrf_token_storage_strategy.fetch(request) || generate_csrf_token
+ end
+
+ decode_csrf_token(csrf_token)
+ end
+
+ See on GitHub
+
+
+
+
@@ -992,22 +992,22 @@
-
-
-
-
- Source:
-
-
-
-
-def request_authenticity_tokens
- [form_authenticity_param, request.x_csrf_token]
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 455
+ def request_authenticity_tokens # :doc:
+ [form_authenticity_param, request.x_csrf_token]
+ end
+
+ See on GitHub
+
+
+
+
@@ -1027,26 +1027,26 @@
-
-
-
-
- Source:
-
-
-
-
-def unmask_token(masked_token)
-
-
- one_time_pad = masked_token[0...AUTHENTICITY_TOKEN_LENGTH]
- encrypted_csrf_token = masked_token[AUTHENTICITY_TOKEN_LENGTH..-1]
- xor_byte_strings(one_time_pad, encrypted_csrf_token)
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 515
+ def unmask_token(masked_token) # :doc:
+ # Split the token into the one-time pad and the encrypted
+ # value and decrypt it.
+ one_time_pad = masked_token[0...AUTHENTICITY_TOKEN_LENGTH]
+ encrypted_csrf_token = masked_token[AUTHENTICITY_TOKEN_LENGTH..-1]
+ xor_byte_strings(one_time_pad, encrypted_csrf_token)
+ end
+
+ See on GitHub
+
+
+
+
@@ -1066,50 +1066,50 @@
-
-
-
-
- Source:
-
-
-
-
-def valid_authenticity_token?(session, encoded_masked_token)
- if encoded_masked_token.nil? || encoded_masked_token.empty? || !encoded_masked_token.is_a?(String)
- return false
- end
-
- begin
- masked_token = decode_csrf_token(encoded_masked_token)
- rescue ArgumentError
- return false
- end
-
-
-
-
-
- if masked_token.length == AUTHENTICITY_TOKEN_LENGTH
-
-
-
- compare_with_real_token masked_token
-
- elsif masked_token.length == AUTHENTICITY_TOKEN_LENGTH * 2
- csrf_token = unmask_token(masked_token)
-
- compare_with_global_token(csrf_token) ||
- compare_with_real_token(csrf_token) ||
- valid_per_form_csrf_token?(csrf_token)
- else
- false
- end
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 483
+ def valid_authenticity_token?(session, encoded_masked_token) # :doc:
+ if encoded_masked_token.nil? || encoded_masked_token.empty? || !encoded_masked_token.is_a?(String)
+ return false
+ end
+
+ begin
+ masked_token = decode_csrf_token(encoded_masked_token)
+ rescue ArgumentError # encoded_masked_token is invalid Base64
+ return false
+ end
+
+ # See if it's actually a masked token or not. In order to
+ # deploy this code, we should be able to handle any unmasked
+ # tokens that we've issued without error.
+
+ if masked_token.length == AUTHENTICITY_TOKEN_LENGTH
+ # This is actually an unmasked token. This is expected if
+ # you have just upgraded to masked tokens, but should stop
+ # happening shortly after installing this gem.
+ compare_with_real_token masked_token
+
+ elsif masked_token.length == AUTHENTICITY_TOKEN_LENGTH * 2
+ csrf_token = unmask_token(masked_token)
+
+ compare_with_global_token(csrf_token) ||
+ compare_with_real_token(csrf_token) ||
+ valid_per_form_csrf_token?(csrf_token)
+ else
+ false # Token is malformed.
+ end
+ end
+
+ See on GitHub
+
+
+
+
@@ -1129,32 +1129,32 @@
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 538
+ def valid_per_form_csrf_token?(token, session = nil) # :doc:
+ if per_form_csrf_tokens
+ correct_token = per_form_csrf_token(
+ session,
+ request.path.chomp("/"),
+ request.request_method
+ )
+
+ ActiveSupport::SecurityUtils.fixed_length_secure_compare(token, correct_token)
+ else
+ false
+ end
+ end
+
+ See on GitHub
+
+
+
+
@@ -1174,28 +1174,28 @@
-
-
-
-
- Source:
-
-
-
-
-def valid_request_origin?
- if forgery_protection_origin_check
-
- raise InvalidAuthenticityToken, NULL_ORIGIN_MESSAGE if request.origin == "null"
- request.origin.nil? || request.origin == request.base_url
- else
- true
- end
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 611
+ def valid_request_origin? # :doc:
+ if forgery_protection_origin_check
+ # We accept blank origin headers because some user agents don't send it.
+ raise InvalidAuthenticityToken, NULL_ORIGIN_MESSAGE if request.origin == "null"
+ request.origin.nil? || request.origin == request.base_url
+ else
+ true
+ end
+ end
+
+ See on GitHub
+
+
+
+
@@ -1222,23 +1222,23 @@
-
-
-
-
- Source:
-
-
-
-
-def verified_request?
- !protect_against_forgery? || request.get? || request.head? ||
- (valid_request_origin? && any_authenticity_token_valid?)
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 442
+ def verified_request? # :doc:
+ !protect_against_forgery? || request.get? || request.head? ||
+ (valid_request_origin? && any_authenticity_token_valid?)
+ end
+
+ See on GitHub
+
+
+
+
@@ -1260,28 +1260,28 @@
-
-
-
-
- Source:
-
-
-
-
-def verify_authenticity_token
- mark_for_same_origin_verification!
-
- if !verified_request?
- logger.warn unverified_request_warning_message if logger && log_warning_on_csrf_failure
-
- handle_unverified_request
- end
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 371
+ def verify_authenticity_token # :doc:
+ mark_for_same_origin_verification!
+
+ if !verified_request?
+ logger.warn unverified_request_warning_message if logger && log_warning_on_csrf_failure
+
+ handle_unverified_request
+ end
+ end
+
+ See on GitHub
+
+
+
+
@@ -1301,27 +1301,27 @@
-
-
-
-
- Source:
-
-
-
-
-def verify_same_origin_request
- if marked_for_same_origin_verification? && non_xhr_javascript_response?
- if logger && log_warning_on_csrf_failure
- logger.warn CROSS_ORIGIN_JAVASCRIPT_WARNING
- end
- raise ActionController::InvalidCrossOriginRequest, CROSS_ORIGIN_JAVASCRIPT_WARNING
- end
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 410
+ def verify_same_origin_request # :doc:
+ if marked_for_same_origin_verification? && non_xhr_javascript_response?
+ if logger && log_warning_on_csrf_failure
+ logger.warn CROSS_ORIGIN_JAVASCRIPT_WARNING
+ end
+ raise ActionController::InvalidCrossOriginRequest, CROSS_ORIGIN_JAVASCRIPT_WARNING
+ end
+ end
+
+ See on GitHub
+
+
+
+
@@ -1341,29 +1341,29 @@
-
-
-
-
- Source:
-
-
-
-
-def xor_byte_strings(s1, s2)
- s2 = s2.dup
- size = s1.bytesize
- i = 0
- while i < size
- s2.setbyte(i, s1.getbyte(i) ^ s2.getbyte(i))
- i += 1
- end
- s2
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 579
+ def xor_byte_strings(s1, s2) # :doc:
+ s2 = s2.dup
+ size = s1.bytesize
+ i = 0
+ while i < size
+ s2.setbyte(i, s1.getbyte(i) ^ s2.getbyte(i))
+ i += 1
+ end
+ s2
+ end
+
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionController/RequestForgeryProtection/ClassMethods.html b/src/classes/ActionController/RequestForgeryProtection/ClassMethods.html
index 6421b148f9..3071767aa6 100644
--- a/src/classes/ActionController/RequestForgeryProtection/ClassMethods.html
+++ b/src/classes/ActionController/RequestForgeryProtection/ClassMethods.html
@@ -165,30 +165,30 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 179
+ def protect_from_forgery(options = {})
+ options = options.reverse_merge(prepend: false)
+
+ self.forgery_protection_strategy = protection_method_class(options[:with] || :null_session)
+ self.request_forgery_protection_token ||= :authenticity_token
+
+ self.csrf_token_storage_strategy = storage_strategy(options[:store] || SessionStore.new)
+
+ before_action :verify_authenticity_token, options
+ append_after_action :verify_same_origin_request
+ end
-
- Source:
-
-
-
-
-def protect_from_forgery(options = {})
- options = options.reverse_merge(prepend: false)
-
- self.forgery_protection_strategy = protection_method_class(options[:with] || :null_session)
- self.request_forgery_protection_token ||= :authenticity_token
-
- self.csrf_token_storage_strategy = storage_strategy(options[:store] || SessionStore.new)
-
- before_action :verify_authenticity_token, options
- append_after_action :verify_same_origin_request
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -213,22 +213,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 196
+ def skip_forgery_protection(options = {})
+ skip_before_action :verify_authenticity_token, options.reverse_merge(raise: false)
+ end
-
- Source:
-
-
-
-
-def skip_forgery_protection(options = {})
- skip_before_action :verify_authenticity_token, options.reverse_merge(raise: false)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionController/RequestForgeryProtection/CookieStore.html b/src/classes/ActionController/RequestForgeryProtection/CookieStore.html
index 8c44ba873f..914f00e853 100644
--- a/src/classes/ActionController/RequestForgeryProtection/CookieStore.html
+++ b/src/classes/ActionController/RequestForgeryProtection/CookieStore.html
@@ -92,22 +92,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 313
+ def initialize(cookie = :csrf_token)
+ @cookie_name = cookie
+ end
-
- Source:
-
-
-
-
-def initialize(cookie = :csrf_token)
- @cookie_name = cookie
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -131,30 +131,30 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 317
+ def fetch(request)
+ contents = request.cookie_jar.encrypted[@cookie_name]
+ return nil if contents.nil?
+
+ value = JSON.parse(contents)
+ return nil unless value.dig("session_id", "public_id") == request.session.id_was&.public_id
+
+ value["token"]
+ rescue JSON::ParserError
+ nil
+ end
-
- Source:
-
-
-
-
-def fetch(request)
- contents = request.cookie_jar.encrypted[@cookie_name]
- return nil if contents.nil?
-
- value = JSON.parse(contents)
- return nil unless value.dig("session_id", "public_id") == request.session.id_was&.public_id
-
- value["token"]
-rescue JSON::ParserError
- nil
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -174,22 +174,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 340
+ def reset(request)
+ request.cookie_jar.delete(@cookie_name)
+ end
-
- Source:
-
-
-
-
-def reset(request)
- request.cookie_jar.delete(@cookie_name)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -209,29 +209,29 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 329
+ def store(request, csrf_token)
+ request.cookie_jar.encrypted.permanent[@cookie_name] = {
+ value: {
+ token: csrf_token,
+ session_id: request.session.id,
+ }.to_json,
+ httponly: true,
+ same_site: :lax,
+ }
+ end
-
- Source:
-
-
-
-
-def store(request, csrf_token)
- request.cookie_jar.encrypted.permanent[@cookie_name] = {
- value: {
- token: csrf_token,
- session_id: request.session.id,
- }.to_json,
- httponly: true,
- same_site: :lax,
- }
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionController/RequestForgeryProtection/DisabledSessionError.html b/src/classes/ActionController/RequestForgeryProtection/DisabledSessionError.html
deleted file mode 100644
index 2fdf133baa..0000000000
--- a/src/classes/ActionController/RequestForgeryProtection/DisabledSessionError.html
+++ /dev/null
@@ -1,125 +0,0 @@
----
-title: ActionController::RequestForgeryProtection::DisabledSessionError
-layout: default
----
-
-
-
-
Ruby on Rails 7.0.0.alpha2
-
-
Class
-
- ActionController::RequestForgeryProtection::DisabledSessionError
-
- <
-
- StandardError
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Methods
-
-
-
-
-
-
-
-
-
-
-
-
-
Constants
-
-
-
- MESSAGE |
- = |
- <<~EOS.squish |
-
-
-
- |
- |
-
-
-
-
-
-
-
-
-
-
-
Class Public methods
-
-
-
-
- new(message = MESSAGE)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Source:
-
-
-
-
-def initialize(message = MESSAGE)
- super
-end
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/classes/ActionController/RequestForgeryProtection/ProtectionMethods/Exception.html b/src/classes/ActionController/RequestForgeryProtection/ProtectionMethods/Exception.html
index 917110f19f..aa36c1b860 100644
--- a/src/classes/ActionController/RequestForgeryProtection/ProtectionMethods/Exception.html
+++ b/src/classes/ActionController/RequestForgeryProtection/ProtectionMethods/Exception.html
@@ -98,22 +98,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 288
+ def initialize(controller)
+ @controller = controller
+ end
-
- Source:
-
-
-
-
-def initialize(controller)
- @controller = controller
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -137,22 +137,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 292
+ def handle_unverified_request
+ raise ActionController::InvalidAuthenticityToken, warning_message
+ end
-
- Source:
-
-
-
-
-def handle_unverified_request
- raise ActionController::InvalidAuthenticityToken, warning_message
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionController/RequestForgeryProtection/ProtectionMethods/NullSession.html b/src/classes/ActionController/RequestForgeryProtection/ProtectionMethods/NullSession.html
index 9a27026c6f..2d28bb79f2 100644
--- a/src/classes/ActionController/RequestForgeryProtection/ProtectionMethods/NullSession.html
+++ b/src/classes/ActionController/RequestForgeryProtection/ProtectionMethods/NullSession.html
@@ -84,22 +84,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 235
+ def initialize(controller)
+ @controller = controller
+ end
-
- Source:
-
-
-
-
-def initialize(controller)
- @controller = controller
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -123,26 +123,26 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 240
+ def handle_unverified_request
+ request = @controller.request
+ request.session = NullSessionHash.new(request)
+ request.flash = nil
+ request.session_options = { skip: true }
+ request.cookie_jar = NullCookieJar.build(request, {})
+ end
-
- Source:
-
-
-
-
-def handle_unverified_request
- request = @controller.request
- request.session = NullSessionHash.new(request)
- request.flash = nil
- request.session_options = { skip: true }
- request.cookie_jar = NullCookieJar.build(request, {})
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionController/RequestForgeryProtection/ProtectionMethods/ResetSession.html b/src/classes/ActionController/RequestForgeryProtection/ProtectionMethods/ResetSession.html
index 6474b2e443..596a819437 100644
--- a/src/classes/ActionController/RequestForgeryProtection/ProtectionMethods/ResetSession.html
+++ b/src/classes/ActionController/RequestForgeryProtection/ProtectionMethods/ResetSession.html
@@ -84,22 +84,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 276
+ def initialize(controller)
+ @controller = controller
+ end
-
- Source:
-
-
-
-
-def initialize(controller)
- @controller = controller
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -123,22 +123,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 280
+ def handle_unverified_request
+ @controller.reset_session
+ end
-
- Source:
-
-
-
-
-def handle_unverified_request
- @controller.reset_session
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionController/RequestForgeryProtection/SessionStore.html b/src/classes/ActionController/RequestForgeryProtection/SessionStore.html
index 358038a80f..67784afff5 100644
--- a/src/classes/ActionController/RequestForgeryProtection/SessionStore.html
+++ b/src/classes/ActionController/RequestForgeryProtection/SessionStore.html
@@ -89,22 +89,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 299
+ def fetch(request)
+ request.session[:_csrf_token]
+ end
-
- Source:
-
-
-
-
-def fetch(request)
- request.session[:_csrf_token]
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -124,22 +124,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 307
+ def reset(request)
+ request.session.delete(:_csrf_token)
+ end
-
- Source:
-
-
-
-
-def reset(request)
- request.session.delete(:_csrf_token)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -159,22 +159,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 303
+ def store(request, csrf_token)
+ request.session[:_csrf_token] = csrf_token
+ end
-
- Source:
-
-
-
-
-def store(request, csrf_token)
- request.session[:_csrf_token] = csrf_token
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionController/Rescue.html b/src/classes/ActionController/Rescue.html
index f7941baf2b..79362deb48 100644
--- a/src/classes/ActionController/Rescue.html
+++ b/src/classes/ActionController/Rescue.html
@@ -97,22 +97,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/rescue.rb, line 19
+ def show_detailed_exceptions?
+ false
+ end
-
- Source:
-
-
-
-
-def show_detailed_exceptions?
- false
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionController/RespondToMismatchError.html b/src/classes/ActionController/RespondToMismatchError.html
index 288aad1eb5..be937dd632 100644
--- a/src/classes/ActionController/RespondToMismatchError.html
+++ b/src/classes/ActionController/RespondToMismatchError.html
@@ -113,22 +113,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/exceptions.rb, line 89
+ def initialize(message = nil)
+ super(message || DEFAULT_MESSAGE)
+ end
-
- Source:
-
-
-
-
-def initialize(message = nil)
- super(message || DEFAULT_MESSAGE)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionController/StrongParameters.html b/src/classes/ActionController/StrongParameters.html
index 24347d1a2f..f7ea8dafa0 100644
--- a/src/classes/ActionController/StrongParameters.html
+++ b/src/classes/ActionController/StrongParameters.html
@@ -146,30 +146,30 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/strong_parameters.rb, line 1275
+ def params
+ @_params ||= begin
+ context = {
+ controller: self.class.name,
+ action: action_name,
+ request: request,
+ params: request.filtered_parameters
+ }
+ Parameters.new(request.parameters, context)
+ end
+ end
-
- Source:
-
-
-
-
-def params
- @_params ||= begin
- context = {
- controller: self.class.name,
- action: action_name,
- request: request,
- params: request.filtered_parameters
- }
- Parameters.new(request.parameters, context)
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -189,22 +189,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/strong_parameters.rb, line 1290
+ def params=(value)
+ @_params = value.is_a?(Hash) ? Parameters.new(value) : value
+ end
-
- Source:
-
-
-
-
-def params=(value)
- @_params = value.is_a?(Hash) ? Parameters.new(value) : value
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionController/TemplateAssertions.html b/src/classes/ActionController/TemplateAssertions.html
deleted file mode 100644
index 4bd84719c4..0000000000
--- a/src/classes/ActionController/TemplateAssertions.html
+++ /dev/null
@@ -1,103 +0,0 @@
----
-title: ActionController::TemplateAssertions
-layout: default
----
-
-
-
-
Ruby on Rails 5.2.5
-
-
Module
-
- ActionController::TemplateAssertions
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Methods
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Instance Public methods
-
-
-
-
- assert_template(options = {}, message = nil)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Source:
-
-
-
-
-def assert_template(options = {}, message = nil)
- raise NoMethodError,
- "assert_template has been extracted to a gem. To continue using it,
- add `gem 'rails-controller-testing'` to your Gemfile."
-end
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/classes/ActionController/TestCase/Behavior.html b/src/classes/ActionController/TestCase/Behavior.html
index af536f183c..a0c83a69b4 100644
--- a/src/classes/ActionController/TestCase/Behavior.html
+++ b/src/classes/ActionController/TestCase/Behavior.html
@@ -190,22 +190,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/test_case.rb, line 564
+ def build_response(klass)
+ klass.create
+ end
-
- Source:
-
-
-
-
-def build_response(klass)
- klass.create
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -225,22 +225,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/test_case.rb, line 524
+ def controller_class_name
+ @controller.class.anonymous? ? "anonymous" : @controller.class.controller_path
+ end
-
- Source:
-
-
-
-
-def controller_class_name
- @controller.class.anonymous? ? "anonymous" : @controller.class.controller_path
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -260,22 +260,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/test_case.rb, line 439
+ def delete(action, **args)
+ process(action, method: "DELETE", **args)
+ end
-
- Source:
-
-
-
-
-def delete(action, **args)
- process(action, method: "DELETE", **args)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -295,22 +295,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/test_case.rb, line 528
+ def generated_path(generated_extras)
+ generated_extras[0]
+ end
-
- Source:
-
-
-
-
-def generated_path(generated_extras)
- generated_extras[0]
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -351,24 +351,24 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/test_case.rb, line 413
+ def get(action, **args)
+ res = process(action, method: "GET", **args)
+ cookies.update res.cookies
+ res
+ end
-
- Source:
-
-
-
-
-def get(action, **args)
- res = process(action, method: "GET", **args)
- cookies.update res.cookies
- res
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -388,22 +388,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/test_case.rb, line 445
+ def head(action, **args)
+ process(action, method: "HEAD", **args)
+ end
-
- Source:
-
-
-
-
-def head(action, **args)
- process(action, method: "HEAD", **args)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -423,22 +423,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/test_case.rb, line 427
+ def patch(action, **args)
+ process(action, method: "PATCH", **args)
+ end
-
- Source:
-
-
-
-
-def patch(action, **args)
- process(action, method: "PATCH", **args)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -458,22 +458,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/test_case.rb, line 421
+ def post(action, **args)
+ process(action, method: "POST", **args)
+ end
-
- Source:
-
-
-
-
-def post(action, **args)
- process(action, method: "POST", **args)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -527,58 +527,58 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/test_case.rb, line 484
+ def process(action, method: "GET", params: nil, session: nil, body: nil, flash: {}, format: nil, xhr: false, as: nil)
+ check_required_ivars
+ @controller.clear_instance_variables_between_requests
+
+ action = +action.to_s
+ http_method = method.to_s.upcase
+
+ @html_document = nil
+
+ cookies.update(@request.cookies)
+ cookies.update_cookies_from_jar
+ @request.set_header "HTTP_COOKIE", cookies.to_header
+ @request.delete_header "action_dispatch.cookies"
+
+ @request = TestRequest.new scrub_env!(@request.env), @request.session, @controller.class
+ @response = build_response @response_klass
+ @response.request = @request
+ @controller.recycle!
+
+ if body
+ @request.set_header "RAW_POST_DATA", body
+ end
+
+ @request.set_header "REQUEST_METHOD", http_method
+
+ if as
+ @request.content_type = Mime[as].to_s
+ format ||= as
+ end
+
+ parameters = (params || {}).symbolize_keys
+
+ if format
+ parameters[:format] = format
+ end
+
+ setup_request(controller_class_name, action, parameters, session, flash, xhr)
+ process_controller_response(action, cookies, xhr)
+ end
-
- Source:
-
-
-
-
-def process(action, method: "GET", params: nil, session: nil, body: nil, flash: {}, format: nil, xhr: false, as: nil)
- check_required_ivars
- @controller.clear_instance_variables_between_requests
-
- action = +action.to_s
- http_method = method.to_s.upcase
-
- @html_document = nil
-
- cookies.update(@request.cookies)
- cookies.update_cookies_from_jar
- @request.set_header "HTTP_COOKIE", cookies.to_header
- @request.delete_header "action_dispatch.cookies"
-
- @request = TestRequest.new scrub_env!(@request.env), @request.session, @controller.class
- @response = build_response @response_klass
- @response.request = @request
- @controller.recycle!
-
- if body
- @request.set_header "RAW_POST_DATA", body
- end
-
- @request.set_header "REQUEST_METHOD", http_method
-
- if as
- @request.content_type = Mime[as].to_s
- format ||= as
- end
-
- parameters = (params || {}).symbolize_keys
-
- if format
- parameters[:format] = format
- end
-
- setup_request(controller_class_name, action, parameters, session, flash, xhr)
- process_controller_response(action, cookies, xhr)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -598,22 +598,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/test_case.rb, line 433
+ def put(action, **args)
+ process(action, method: "PUT", **args)
+ end
-
- Source:
-
-
-
-
-def put(action, **args)
- process(action, method: "PUT", **args)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -633,22 +633,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/test_case.rb, line 532
+ def query_parameter_names(generated_extras)
+ generated_extras[1] + [:controller, :action]
+ end
-
- Source:
-
-
-
-
-def query_parameter_names(generated_extras)
- generated_extras[1] + [:controller, :action]
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -668,46 +668,46 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/test_case.rb, line 536
+ def setup_controller_request_and_response
+ @controller = nil unless defined? @controller
+
+ @response_klass = ActionDispatch::TestResponse
+
+ if klass = self.class.controller_class
+ if klass < ActionController::Live
+ @response_klass = LiveTestResponse
+ end
+ unless @controller
+ begin
+ @controller = klass.new
+ rescue
+ warn "could not construct controller #{klass}" if $VERBOSE
+ end
+ end
+ end
+
+ @request = TestRequest.create(@controller.class)
+ @response = build_response @response_klass
+ @response.request = @request
+
+ if @controller
+ @controller.request = @request
+ @controller.params = {}
+ end
+ end
-
- Source:
-
-
-
-
-def setup_controller_request_and_response
- @controller = nil unless defined? @controller
-
- @response_klass = ActionDispatch::TestResponse
-
- if klass = self.class.controller_class
- if klass < ActionController::Live
- @response_klass = LiveTestResponse
- end
- unless @controller
- begin
- @controller = klass.new
- rescue
- warn "could not construct controller #{klass}" if $VERBOSE
- end
- end
- end
-
- @request = TestRequest.create(@controller.class)
- @response = build_response @response_klass
- @response.request = @request
-
- if @controller
- @controller.request = @request
- @controller.params = {}
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionController/TestCase/Behavior/ClassMethods.html b/src/classes/ActionController/TestCase/Behavior/ClassMethods.html
index f33e4562ef..a2385953c9 100644
--- a/src/classes/ActionController/TestCase/Behavior/ClassMethods.html
+++ b/src/classes/ActionController/TestCase/Behavior/ClassMethods.html
@@ -87,26 +87,26 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/test_case.rb, line 378
+ def controller_class
+ if current_controller_class = _controller_class
+ current_controller_class
+ else
+ self.controller_class = determine_default_controller_class(name)
+ end
+ end
-
- Source:
-
-
-
-
-def controller_class
- if current_controller_class = _controller_class
- current_controller_class
- else
- self.controller_class = determine_default_controller_class(name)
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -126,22 +126,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/test_case.rb, line 374
+ def controller_class=(new_class)
+ self._controller_class = new_class
+ end
-
- Source:
-
-
-
-
-def controller_class=(new_class)
- self._controller_class = new_class
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -161,24 +161,24 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/test_case.rb, line 386
+ def determine_default_controller_class(name)
+ determine_constant_from_test_name(name) do |constant|
+ Class === constant && constant < ActionController::Metal
+ end
+ end
-
- Source:
-
-
-
-
-def determine_default_controller_class(name)
- determine_constant_from_test_name(name) do |constant|
- Class === constant && constant < ActionController::Metal
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -203,29 +203,29 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/test_case.rb, line 363
+ def tests(controller_class)
+ case controller_class
+ when String, Symbol
+ self.controller_class = "#{controller_class.to_s.camelize}Controller".constantize
+ when Class
+ self.controller_class = controller_class
+ else
+ raise ArgumentError, "controller class must be a String, Symbol, or Class"
+ end
+ end
-
- Source:
-
-
-
-
-def tests(controller_class)
- case controller_class
- when String, Symbol
- self.controller_class = "#{controller_class.to_s.camelize}Controller".constantize
- when Class
- self.controller_class = controller_class
- else
- raise ArgumentError, "controller class must be a String, Symbol, or Class"
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionController/UrlFor.html b/src/classes/ActionController/UrlFor.html
index f589671bce..67a522246a 100644
--- a/src/classes/ActionController/UrlFor.html
+++ b/src/classes/ActionController/UrlFor.html
@@ -115,23 +115,23 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/url_for.rb, line 30
+ def initialize(...)
+ super
+ @_url_options = nil
+ end
-
- Source:
-
-
-
-
-def initialize(...)
- super
- @_url_options = nil
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -155,46 +155,46 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_controller/metal/url_for.rb, line 35
+ def url_options
+ @_url_options ||= {
+ host: request.host,
+ port: request.optional_port,
+ protocol: request.protocol,
+ _recall: request.path_parameters
+ }.merge!(super).freeze
+
+ if (same_origin = _routes.equal?(request.routes)) ||
+ (script_name = request.engine_script_name(_routes)) ||
+ (original_script_name = request.original_script_name)
+
+ options = @_url_options.dup
+ if original_script_name
+ options[:original_script_name] = original_script_name
+ else
+ if same_origin
+ options[:script_name] = request.script_name.empty? ? "" : request.script_name.dup
+ else
+ options[:script_name] = script_name
+ end
+ end
+ options.freeze
+ else
+ @_url_options
+ end
+ end
-
- Source:
-
-
-
-
-def url_options
- @_url_options ||= {
- host: request.host,
- port: request.optional_port,
- protocol: request.protocol,
- _recall: request.path_parameters
- }.merge!(super).freeze
-
- if (same_origin = _routes.equal?(request.routes)) ||
- (script_name = request.engine_script_name(_routes)) ||
- (original_script_name = request.original_script_name)
-
- options = @_url_options.dup
- if original_script_name
- options[:original_script_name] = original_script_name
- else
- if same_origin
- options[:script_name] = request.script_name.empty? ? "" : request.script_name.dup
- else
- options[:script_name] = script_name
- end
- end
- options.freeze
- else
- @_url_options
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionController/UrlGenerationError.html b/src/classes/ActionController/UrlGenerationError.html
deleted file mode 100644
index a69dea5c54..0000000000
--- a/src/classes/ActionController/UrlGenerationError.html
+++ /dev/null
@@ -1,73 +0,0 @@
----
-title: ActionController::UrlGenerationError
-layout: default
----
-
-
-
-
Ruby on Rails 6.1.7
-
-
Class
-
- ActionController::UrlGenerationError
-
- <
-
- ActionController::ActionControllerError
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Namespace
-
-
-
-
-
Class
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/classes/ActionController/UrlGenerationError/Correction.html b/src/classes/ActionController/UrlGenerationError/Correction.html
deleted file mode 100644
index e11005503a..0000000000
--- a/src/classes/ActionController/UrlGenerationError/Correction.html
+++ /dev/null
@@ -1,158 +0,0 @@
----
-title: ActionController::UrlGenerationError::Correction
-layout: default
----
-
-
-
-
Ruby on Rails 6.1.7
-
-
Class
-
- ActionController::UrlGenerationError::Correction
-
- <
-
- Object
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Methods
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Class Public methods
-
-
-
-
- new(error)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Source:
-
-
-
-
-def initialize(error)
- @error = error
-end
-
-
-
-
-
-
-
-
Instance Public methods
-
-
-
-
- corrections()
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Source:
-
-
-
-
-def corrections
- if @error.method_name
- maybe_these = @error.routes.named_routes.helper_names.grep(/#{@error.route_name}/)
- maybe_these -= [@error.method_name.to_s]
-
- maybe_these.sort_by { |n|
- DidYouMean::Jaro.distance(@error.route_name, n)
- }.reverse.first(4)
- else
- []
- end
-end
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/classes/ActionDispatch.html b/src/classes/ActionDispatch.html
index c70b7bd7ba..2275231b4b 100644
--- a/src/classes/ActionDispatch.html
+++ b/src/classes/ActionDispatch.html
@@ -403,23 +403,23 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch.rb, line 141
+ def eager_load!
+ super
+ Routing.eager_load!
+ end
-
- Source:
-
-
-
-
-def eager_load!
- super
- Routing.eager_load!
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/AssertionResponse.html b/src/classes/ActionDispatch/AssertionResponse.html
index b978c5f02f..9270b4c7a9 100644
--- a/src/classes/ActionDispatch/AssertionResponse.html
+++ b/src/classes/ActionDispatch/AssertionResponse.html
@@ -112,31 +112,31 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/assertion_response.rb, line 20
+ def initialize(code_or_name)
+ if code_or_name.is_a?(Symbol)
+ @name = code_or_name
+ @code = code_from_name(code_or_name)
+ else
+ @name = name_from_code(code_or_name)
+ @code = code_or_name
+ end
+
+ raise ArgumentError, "Invalid response name: #{name}" if @code.nil?
+ raise ArgumentError, "Invalid response code: #{code}" if @name.nil?
+ end
-
- Source:
-
-
-
-
-def initialize(code_or_name)
- if code_or_name.is_a?(Symbol)
- @name = code_or_name
- @code = code_from_name(code_or_name)
- else
- @name = name_from_code(code_or_name)
- @code = code_or_name
- end
-
- raise ArgumentError, "Invalid response name: #{name}" if @code.nil?
- raise ArgumentError, "Invalid response code: #{code}" if @name.nil?
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -160,22 +160,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/assertion_response.rb, line 33
+ def code_and_name
+ "#{code}: #{name}"
+ end
-
- Source:
-
-
-
-
-def code_and_name
- "#{code}: #{name}"
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/Assertions.html b/src/classes/ActionDispatch/Assertions.html
index 3fc8507bfc..444d802497 100644
--- a/src/classes/ActionDispatch/Assertions.html
+++ b/src/classes/ActionDispatch/Assertions.html
@@ -122,26 +122,26 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/assertions.rb, line 15
+ def html_document
+ @html_document ||= if @response.media_type&.end_with?("xml")
+ Nokogiri::XML::Document.parse(@response.body)
+ else
+ Rails::Dom::Testing.html_document.parse(@response.body)
+ end
+ end
-
- Source:
-
-
-
-
-def html_document
- @html_document ||= if @response.media_type&.end_with?("xml")
- Nokogiri::XML::Document.parse(@response.body)
- else
- Rails::Dom::Testing.html_document.parse(@response.body)
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/Assertions/ResponseAssertions.html b/src/classes/ActionDispatch/Assertions/ResponseAssertions.html
index 2c38d6a459..8d390ae8cb 100644
--- a/src/classes/ActionDispatch/Assertions/ResponseAssertions.html
+++ b/src/classes/ActionDispatch/Assertions/ResponseAssertions.html
@@ -102,32 +102,32 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/assertions/response.rb, line 57
+ def assert_redirected_to(url_options = {}, options = {}, message = nil)
+ options, message = {}, options unless options.is_a?(Hash)
+
+ status = options[:status] || :redirect
+ assert_response(status, message)
+ return true if url_options === @response.location
+
+ redirect_is = normalize_argument_to_redirection(@response.location)
+ redirect_expected = normalize_argument_to_redirection(url_options)
+
+ message ||= "Expected response to be a redirect to <#{redirect_expected}> but was a redirect to <#{redirect_is}>"
+ assert_operator redirect_expected, :===, redirect_is, message
+ end
-
- Source:
-
-
-
-
-def assert_redirected_to(url_options = {}, options = {}, message = nil)
- options, message = {}, options unless options.is_a?(Hash)
-
- status = options[:status] || :redirect
- assert_response(status, message)
- return true if url_options === @response.location
-
- redirect_is = normalize_argument_to_redirection(@response.location)
- redirect_expected = normalize_argument_to_redirection(url_options)
-
- message ||= "Expected response to be a redirect to <#{redirect_expected}> but was a redirect to <#{redirect_is}>"
- assert_operator redirect_expected, :===, redirect_is, message
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -165,28 +165,28 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/assertions/response.rb, line 30
+ def assert_response(type, message = nil)
+ message ||= generate_response_message(type)
+
+ if RESPONSE_PREDICATES.key?(type)
+ assert @response.public_send(RESPONSE_PREDICATES[type]), message
+ else
+ assert_equal AssertionResponse.new(type).code, @response.response_code, message
+ end
+ end
-
- Source:
-
-
-
-
-def assert_response(type, message = nil)
- message ||= generate_response_message(type)
-
- if RESPONSE_PREDICATES.key?(type)
- assert @response.public_send(RESPONSE_PREDICATES[type]), message
- else
- assert_equal AssertionResponse.new(type).code, @response.response_code, message
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/Assertions/RoutingAssertions.html b/src/classes/ActionDispatch/Assertions/RoutingAssertions.html
index 3a3a38fc5e..be3a2c8046 100644
--- a/src/classes/ActionDispatch/Assertions/RoutingAssertions.html
+++ b/src/classes/ActionDispatch/Assertions/RoutingAssertions.html
@@ -125,40 +125,40 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/assertions/routing.rb, line 115
+ def assert_generates(expected_path, options, defaults = {}, extras = {}, message = nil)
+ if expected_path.include?("://")
+ fail_on(URI::InvalidURIError, message) do
+ uri = URI.parse(expected_path)
+ expected_path = uri.path.to_s.empty? ? "/" : uri.path
+ end
+ else
+ expected_path = "/#{expected_path}" unless expected_path.start_with?("/")
+ end
+
+ options = options.clone
+ generated_path, query_string_keys = @routes.generate_extras(options, defaults)
+ found_extras = options.reject { |k, _| ! query_string_keys.include? k }
+
+ msg = message || sprintf("found extras <%s>, not <%s>", found_extras, extras)
+ assert_equal(extras, found_extras, msg)
+
+ msg = message || sprintf("The generated path <%s> did not match <%s>", generated_path,
+ expected_path)
+ assert_equal(expected_path, generated_path, msg)
+ end
-
- Source:
-
-
-
-
-def assert_generates(expected_path, options, defaults = {}, extras = {}, message = nil)
- if expected_path.include?("://")
- fail_on(URI::InvalidURIError, message) do
- uri = URI.parse(expected_path)
- expected_path = uri.path.to_s.empty? ? "/" : uri.path
- end
- else
- expected_path = "/#{expected_path}" unless expected_path.start_with?("/")
- end
-
- options = options.clone
- generated_path, query_string_keys = @routes.generate_extras(options, defaults)
- found_extras = options.reject { |k, _| ! query_string_keys.include? k }
-
- msg = message || sprintf("found extras <%s>, not <%s>", found_extras, extras)
- assert_equal(extras, found_extras, msg)
-
- msg = message || sprintf("The generated path <%s> did not match <%s>", generated_path,
- expected_path)
- assert_equal(expected_path, generated_path, msg)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -205,39 +205,39 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/assertions/routing.rb, line 77
+ def assert_recognizes(expected_options, path, extras = {}, msg = nil)
+ if path.is_a?(Hash) && path[:method].to_s == "all"
+ [:get, :post, :put, :delete].each do |method|
+ assert_recognizes(expected_options, path.merge(method: method), extras, msg)
+ end
+ else
+ request = recognized_request_for(path, extras, msg)
+
+ expected_options = expected_options.clone
+
+ expected_options.stringify_keys!
+
+ msg = message(msg, "") {
+ sprintf("The recognized options <%s> did not match <%s>, difference:",
+ request.path_parameters, expected_options)
+ }
+
+ assert_equal(expected_options, request.path_parameters, msg)
+ end
+ end
-
- Source:
-
-
-
-
-def assert_recognizes(expected_options, path, extras = {}, msg = nil)
- if path.is_a?(Hash) && path[:method].to_s == "all"
- [:get, :post, :put, :delete].each do |method|
- assert_recognizes(expected_options, path.merge(method: method), extras, msg)
- end
- else
- request = recognized_request_for(path, extras, msg)
-
- expected_options = expected_options.clone
-
- expected_options.stringify_keys!
-
- msg = message(msg, "") {
- sprintf("The recognized options <%s> did not match <%s>, difference:",
- request.path_parameters, expected_options)
- }
-
- assert_equal(expected_options, request.path_parameters, msg)
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -275,30 +275,30 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/assertions/routing.rb, line 158
+ def assert_routing(path, options, defaults = {}, extras = {}, message = nil)
+ assert_recognizes(options, path, extras, message)
+
+ controller, default_controller = options[:controller], defaults[:controller]
+ if controller && controller.include?(?/) && default_controller && default_controller.include?(?/)
+ options[:controller] = "/#{controller}"
+ end
+
+ generate_options = options.dup.delete_if { |k, _| defaults.key?(k) }
+ assert_generates(path.is_a?(Hash) ? path[:path] : path, generate_options, defaults, extras, message)
+ end
-
- Source:
-
-
-
-
-def assert_routing(path, options, defaults = {}, extras = {}, message = nil)
- assert_recognizes(options, path, extras, message)
-
- controller, default_controller = options[:controller], defaults[:controller]
- if controller && controller.include?(?/) && default_controller && default_controller.include?(?/)
- options[:controller] = "/#{controller}"
- end
-
- generate_options = options.dup.delete_if { |k, _| defaults.key?(k) }
- assert_generates(path.is_a?(Hash) ? path[:path] : path, generate_options, defaults, extras, message)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -318,26 +318,26 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/assertions/routing.rb, line 191
+ def method_missing(selector, *args, &block)
+ if defined?(@controller) && @controller && defined?(@routes) && @routes && @routes.named_routes.route_defined?(selector)
+ @controller.public_send(selector, *args, &block)
+ else
+ super
+ end
+ end
-
- Source:
-
-
-
-
-def method_missing(selector, *args, &block)
- if defined?(@controller) && @controller && defined?(@routes) && @routes && @routes.named_routes.route_defined?(selector)
- @controller.public_send(selector, *args, &block)
- else
- super
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -367,25 +367,25 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/assertions/routing.rb, line 183
+ def with_routing(&block)
+ old_routes, old_controller = @routes, @controller
+ create_routes(&block)
+ ensure
+ reset_routes(old_routes, old_controller)
+ end
-
- Source:
-
-
-
-
-def with_routing(&block)
- old_routes, old_controller = @routes, @controller
- create_routes(&block)
-ensure
- reset_routes(old_routes, old_controller)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/Assertions/RoutingAssertions/ClassMethods.html b/src/classes/ActionDispatch/Assertions/RoutingAssertions/ClassMethods.html
index 8a9d2af786..42fbbeafbf 100644
--- a/src/classes/ActionDispatch/Assertions/RoutingAssertions/ClassMethods.html
+++ b/src/classes/ActionDispatch/Assertions/RoutingAssertions/ClassMethods.html
@@ -84,31 +84,31 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/assertions/routing.rb, line 28
+ def with_routing(&block)
+ old_routes, old_controller = nil
+
+ setup do
+ old_routes, old_controller = @routes, @controller
+ create_routes(&block)
+ end
+
+ teardown do
+ reset_routes(old_routes, old_controller)
+ end
+ end
-
- Source:
-
-
-
-
-def with_routing(&block)
- old_routes, old_controller = nil
-
- setup do
- old_routes, old_controller = @routes, @controller
- create_routes(&block)
- end
-
- teardown do
- reset_routes(old_routes, old_controller)
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/AssumeSSL.html b/src/classes/ActionDispatch/AssumeSSL.html
index ab13cb565b..7d25a019d3 100644
--- a/src/classes/ActionDispatch/AssumeSSL.html
+++ b/src/classes/ActionDispatch/AssumeSSL.html
@@ -92,22 +92,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/assume_ssl.rb, line 11
+ def initialize(app)
+ @app = app
+ end
-
- Source:
-
-
-
-
-def initialize(app)
- @app = app
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -131,27 +131,27 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/assume_ssl.rb, line 15
+ def call(env)
+ env["HTTPS"] = "on"
+ env["HTTP_X_FORWARDED_PORT"] = "443"
+ env["HTTP_X_FORWARDED_PROTO"] = "https"
+ env["rack.url_scheme"] = "https"
+
+ @app.call(env)
+ end
-
- Source:
-
-
-
-
-def call(env)
- env["HTTPS"] = "on"
- env["HTTP_X_FORWARDED_PORT"] = "443"
- env["HTTP_X_FORWARDED_PROTO"] = "https"
- env["rack.url_scheme"] = "https"
-
- @app.call(env)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/Callbacks.html b/src/classes/ActionDispatch/Callbacks.html
index c52f038722..a490212358 100644
--- a/src/classes/ActionDispatch/Callbacks.html
+++ b/src/classes/ActionDispatch/Callbacks.html
@@ -114,22 +114,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/callbacks.rb, line 17
+ def after(*args, &block)
+ set_callback(:call, :after, *args, &block)
+ end
-
- Source:
-
-
-
-
-def after(*args, &block)
- set_callback(:call, :after, *args, &block)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -149,22 +149,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/callbacks.rb, line 13
+ def before(*args, &block)
+ set_callback(:call, :before, *args, &block)
+ end
-
- Source:
-
-
-
-
-def before(*args, &block)
- set_callback(:call, :before, *args, &block)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -184,22 +184,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/callbacks.rb, line 22
+ def initialize(app)
+ @app = app
+ end
-
- Source:
-
-
-
-
-def initialize(app)
- @app = app
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -223,28 +223,28 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/callbacks.rb, line 26
+ def call(env)
+ error = nil
+ result = run_callbacks :call do
+ @app.call(env)
+ rescue => error
+ end
+ raise error if error
+ result
+ end
-
- Source:
-
-
-
-
-def call(env)
- error = nil
- result = run_callbacks :call do
- @app.call(env)
- rescue => error
- end
- raise error if error
- result
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/ContentSecurityPolicy.html b/src/classes/ActionDispatch/ContentSecurityPolicy.html
index 06520a32dc..3a2fc7e38b 100644
--- a/src/classes/ActionDispatch/ContentSecurityPolicy.html
+++ b/src/classes/ActionDispatch/ContentSecurityPolicy.html
@@ -171,23 +171,23 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 174
+ def initialize
+ @directives = {}
+ yield self if block_given?
+ end
-
- Source:
-
-
-
-
-def initialize
- @directives = {}
- yield self if block_given?
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -219,26 +219,26 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 202
+ def block_all_mixed_content(enabled = true)
+ if enabled
+ @directives["block-all-mixed-content"] = true
+ else
+ @directives.delete("block-all-mixed-content")
+ end
+ end
-
- Source:
-
-
-
-
-def block_all_mixed_content(enabled = true)
- if enabled
- @directives["block-all-mixed-content"] = true
- else
- @directives.delete("block-all-mixed-content")
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -258,23 +258,23 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 291
+ def build(context = nil, nonce = nil, nonce_directives = nil)
+ nonce_directives = DEFAULT_NONCE_DIRECTIVES if nonce_directives.nil?
+ build_directives(context, nonce, nonce_directives).compact.join("; ")
+ end
-
- Source:
-
-
-
-
-def build(context = nil, nonce = nil, nonce_directives = nil)
- nonce_directives = DEFAULT_NONCE_DIRECTIVES if nonce_directives.nil?
- build_directives(context, nonce, nonce_directives).compact.join("; ")
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -294,22 +294,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 179
+ def initialize_copy(other)
+ @directives = other.directives.deep_dup
+ end
-
- Source:
-
-
-
-
-def initialize_copy(other)
- @directives = other.directives.deep_dup
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -337,26 +337,26 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 218
+ def plugin_types(*types)
+ if types.first
+ @directives["plugin-types"] = types
+ else
+ @directives.delete("plugin-types")
+ end
+ end
-
- Source:
-
-
-
-
-def plugin_types(*types)
- if types.first
- @directives["plugin-types"] = types
- else
- @directives.delete("plugin-types")
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -379,22 +379,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 231
+ def report_uri(uri)
+ @directives["report-uri"] = [uri]
+ end
-
- Source:
-
-
-
-
-def report_uri(uri)
- @directives["report-uri"] = [uri]
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -422,26 +422,26 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 244
+ def require_sri_for(*types)
+ if types.first
+ @directives["require-sri-for"] = types
+ else
+ @directives.delete("require-sri-for")
+ end
+ end
-
- Source:
-
-
-
-
-def require_sri_for(*types)
- if types.first
- @directives["require-sri-for"] = types
- else
- @directives.delete("require-sri-for")
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -474,28 +474,28 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 265
+ def sandbox(*values)
+ if values.empty?
+ @directives["sandbox"] = true
+ elsif values.first
+ @directives["sandbox"] = values
+ else
+ @directives.delete("sandbox")
+ end
+ end
-
- Source:
-
-
-
-
-def sandbox(*values)
- if values.empty?
- @directives["sandbox"] = true
- elsif values.first
- @directives["sandbox"] = values
- else
- @directives.delete("sandbox")
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -523,26 +523,26 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 283
+ def upgrade_insecure_requests(enabled = true)
+ if enabled
+ @directives["upgrade-insecure-requests"] = true
+ else
+ @directives.delete("upgrade-insecure-requests")
+ end
+ end
-
- Source:
-
-
-
-
-def upgrade_insecure_requests(enabled = true)
- if enabled
- @directives["upgrade-insecure-requests"] = true
- else
- @directives.delete("upgrade-insecure-requests")
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/ContentSecurityPolicy/Middleware.html b/src/classes/ActionDispatch/ContentSecurityPolicy/Middleware.html
index e18a97d494..8bf3692051 100644
--- a/src/classes/ActionDispatch/ContentSecurityPolicy/Middleware.html
+++ b/src/classes/ActionDispatch/ContentSecurityPolicy/Middleware.html
@@ -84,22 +84,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 28
+ def initialize(app)
+ @app = app
+ end
-
- Source:
-
-
-
-
-def initialize(app)
- @app = app
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -123,39 +123,39 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 32
+ def call(env)
+ status, headers, _ = response = @app.call(env)
+
+ # Returning CSP headers with a 304 Not Modified is harmful, since nonces in the new
+ # CSP headers might not match nonces in the cached HTML.
+ return response if status == 304
+
+ return response if policy_present?(headers)
+
+ request = ActionDispatch::Request.new env
+
+ if policy = request.content_security_policy
+ nonce = request.content_security_policy_nonce
+ nonce_directives = request.content_security_policy_nonce_directives
+ context = request.controller_instance || request
+ headers[header_name(request)] = policy.build(context, nonce, nonce_directives)
+ end
+
+ response
+ end
-
- Source:
-
-
-
-
-def call(env)
- status, headers, _ = response = @app.call(env)
-
-
-
- return response if status == 304
-
- return response if policy_present?(headers)
-
- request = ActionDispatch::Request.new env
-
- if policy = request.content_security_policy
- nonce = request.content_security_policy_nonce
- nonce_directives = request.content_security_policy_nonce_directives
- context = request.controller_instance || request
- headers[header_name(request)] = policy.build(context, nonce, nonce_directives)
- end
-
- response
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/ContentSecurityPolicy/Request.html b/src/classes/ActionDispatch/ContentSecurityPolicy/Request.html
index 5745260b51..c9b49b5f66 100644
--- a/src/classes/ActionDispatch/ContentSecurityPolicy/Request.html
+++ b/src/classes/ActionDispatch/ContentSecurityPolicy/Request.html
@@ -173,22 +173,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 75
+ def content_security_policy
+ get_header(POLICY)
+ end
-
- Source:
-
-
-
-
-def content_security_policy
- get_header(POLICY)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -208,22 +208,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 79
+ def content_security_policy=(policy)
+ set_header(POLICY, policy)
+ end
-
- Source:
-
-
-
-
-def content_security_policy=(policy)
- set_header(POLICY, policy)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -243,28 +243,28 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 107
+ def content_security_policy_nonce
+ if content_security_policy_nonce_generator
+ if nonce = get_header(NONCE)
+ nonce
+ else
+ set_header(NONCE, generate_content_security_policy_nonce)
+ end
+ end
+ end
-
- Source:
-
-
-
-
-def content_security_policy_nonce
- if content_security_policy_nonce_generator
- if nonce = get_header(NONCE)
- nonce
- else
- set_header(NONCE, generate_content_security_policy_nonce)
- end
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -284,22 +284,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 99
+ def content_security_policy_nonce_directives
+ get_header(NONCE_DIRECTIVES)
+ end
-
- Source:
-
-
-
-
-def content_security_policy_nonce_directives
- get_header(NONCE_DIRECTIVES)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -319,22 +319,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 103
+ def content_security_policy_nonce_directives=(generator)
+ set_header(NONCE_DIRECTIVES, generator)
+ end
-
- Source:
-
-
-
-
-def content_security_policy_nonce_directives=(generator)
- set_header(NONCE_DIRECTIVES, generator)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -354,22 +354,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 91
+ def content_security_policy_nonce_generator
+ get_header(NONCE_GENERATOR)
+ end
-
- Source:
-
-
-
-
-def content_security_policy_nonce_generator
- get_header(NONCE_GENERATOR)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -389,22 +389,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 95
+ def content_security_policy_nonce_generator=(generator)
+ set_header(NONCE_GENERATOR, generator)
+ end
-
- Source:
-
-
-
-
-def content_security_policy_nonce_generator=(generator)
- set_header(NONCE_GENERATOR, generator)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -424,22 +424,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 83
+ def content_security_policy_report_only
+ get_header(POLICY_REPORT_ONLY)
+ end
-
- Source:
-
-
-
-
-def content_security_policy_report_only
- get_header(POLICY_REPORT_ONLY)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -459,22 +459,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 87
+ def content_security_policy_report_only=(value)
+ set_header(POLICY_REPORT_ONLY, value)
+ end
-
- Source:
-
-
-
-
-def content_security_policy_report_only=(value)
- set_header(POLICY_REPORT_ONLY, value)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/Cookies.html b/src/classes/ActionDispatch/Cookies.html
index 32a3df07a0..cebf724f19 100644
--- a/src/classes/ActionDispatch/Cookies.html
+++ b/src/classes/ActionDispatch/Cookies.html
@@ -403,22 +403,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/cookies.rb, line 683
+ def initialize(app)
+ @app = app
+ end
-
- Source:
-
-
-
-
-def initialize(app)
- @app = app
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -442,33 +442,33 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/cookies.rb, line 687
+ def call(env)
+ request = ActionDispatch::Request.new(env)
+ response = @app.call(env)
+
+ if request.have_cookie_jar?
+ cookie_jar = request.cookie_jar
+ unless cookie_jar.committed?
+ response = Rack::Response[*response]
+ cookie_jar.write(response)
+ end
+ end
+
+ response.to_a
+ end
-
- Source:
-
-
-
-
-def call(env)
- request = ActionDispatch::Request.new(env)
- response = @app.call(env)
-
- if request.have_cookie_jar?
- cookie_jar = request.cookie_jar
- unless cookie_jar.committed?
- response = Rack::Response[*response]
- cookie_jar.write(response)
- end
- end
-
- response.to_a
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/Cookies/ChainedCookieJars.html b/src/classes/ActionDispatch/Cookies/ChainedCookieJars.html
index 666eac20fa..43eda5f5d9 100644
--- a/src/classes/ActionDispatch/Cookies/ChainedCookieJars.html
+++ b/src/classes/ActionDispatch/Cookies/ChainedCookieJars.html
@@ -105,22 +105,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/cookies.rb, line 258
+ def encrypted
+ @encrypted ||= EncryptedKeyRotatingCookieJar.new(self)
+ end
-
- Source:
-
-
-
-
-def encrypted
- @encrypted ||= EncryptedKeyRotatingCookieJar.new(self)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -152,22 +152,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/cookies.rb, line 224
+ def permanent
+ @permanent ||= PermanentCookieJar.new(self)
+ end
-
- Source:
-
-
-
-
-def permanent
- @permanent ||= PermanentCookieJar.new(self)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -197,22 +197,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/cookies.rb, line 240
+ def signed
+ @signed ||= SignedKeyRotatingCookieJar.new(self)
+ end
-
- Source:
-
-
-
-
-def signed
- @signed ||= SignedKeyRotatingCookieJar.new(self)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -232,27 +232,27 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/cookies.rb, line 264
+ def signed_or_encrypted
+ @signed_or_encrypted ||=
+ if request.secret_key_base.present?
+ encrypted
+ else
+ signed
+ end
+ end
-
- Source:
-
-
-
-
-def signed_or_encrypted
- @signed_or_encrypted ||=
- if request.secret_key_base.present?
- encrypted
- else
- signed
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/DebugExceptions.html b/src/classes/ActionDispatch/DebugExceptions.html
index 8d70525923..a0c1d36351 100644
--- a/src/classes/ActionDispatch/DebugExceptions.html
+++ b/src/classes/ActionDispatch/DebugExceptions.html
@@ -96,25 +96,25 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/debug_exceptions.rb, line 21
+ def initialize(app, routes_app = nil, response_format = :default, interceptors = self.class.interceptors)
+ @app = app
+ @routes_app = routes_app
+ @response_format = response_format
+ @interceptors = interceptors
+ end
-
- Source:
-
-
-
-
-def initialize(app, routes_app = nil, response_format = :default, interceptors = self.class.interceptors)
- @app = app
- @routes_app = routes_app
- @response_format = response_format
- @interceptors = interceptors
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -134,23 +134,23 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/debug_exceptions.rb, line 16
+ def self.register_interceptor(object = nil, &block)
+ interceptor = object || block
+ interceptors << interceptor
+ end
-
- Source:
-
-
-
-
-def self.register_interceptor(object = nil, &block)
- interceptor = object || block
- interceptors << interceptor
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -174,37 +174,37 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/debug_exceptions.rb, line 28
+ def call(env)
+ _, headers, body = response = @app.call(env)
+
+ if headers[Constants::X_CASCADE] == "pass"
+ body.close if body.respond_to?(:close)
+ raise ActionController::RoutingError, "No route matches [#{env['REQUEST_METHOD']}] #{env['PATH_INFO'].inspect}"
+ end
+
+ response
+ rescue Exception => exception
+ request = ActionDispatch::Request.new env
+ backtrace_cleaner = request.get_header("action_dispatch.backtrace_cleaner")
+ wrapper = ExceptionWrapper.new(backtrace_cleaner, exception)
+
+ invoke_interceptors(request, exception, wrapper)
+ raise exception unless wrapper.show?(request)
+ render_exception(request, exception, wrapper)
+ end
-
- Source:
-
-
-
-
-def call(env)
- _, headers, body = response = @app.call(env)
-
- if headers[Constants::X_CASCADE] == "pass"
- body.close if body.respond_to?(:close)
- raise ActionController::RoutingError, "No route matches [#{env['REQUEST_METHOD']}] #{env['PATH_INFO'].inspect}"
- end
-
- response
-rescue Exception => exception
- request = ActionDispatch::Request.new env
- backtrace_cleaner = request.get_header("action_dispatch.backtrace_cleaner")
- wrapper = ExceptionWrapper.new(backtrace_cleaner, exception)
-
- invoke_interceptors(request, exception, wrapper)
- raise exception unless wrapper.show?(request)
- render_exception(request, exception, wrapper)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/DebugLocks.html b/src/classes/ActionDispatch/DebugLocks.html
index 57cb7f1eba..f4041c9e23 100644
--- a/src/classes/ActionDispatch/DebugLocks.html
+++ b/src/classes/ActionDispatch/DebugLocks.html
@@ -105,23 +105,23 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/debug_locks.rb, line 28
+ def initialize(app, path = "/rails/locks")
+ @app = app
+ @path = path
+ end
-
- Source:
-
-
-
-
-def initialize(app, path = "/rails/locks")
- @app = app
- @path = path
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -145,31 +145,31 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/debug_locks.rb, line 33
+ def call(env)
+ req = ActionDispatch::Request.new env
+
+ if req.get?
+ path = req.path_info.chomp("/")
+ if path == @path
+ return render_details(req)
+ end
+ end
+
+ @app.call(env)
+ end
-
- Source:
-
-
-
-
-def call(env)
- req = ActionDispatch::Request.new env
-
- if req.get?
- path = req.path_info.chomp("/")
- if path == @path
- return render_details(req)
- end
- end
-
- @app.call(env)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/ExceptionWrapper.html b/src/classes/ActionDispatch/ExceptionWrapper.html
index ace307d74a..804eb91332 100644
--- a/src/classes/ActionDispatch/ExceptionWrapper.html
+++ b/src/classes/ActionDispatch/ExceptionWrapper.html
@@ -242,29 +242,29 @@
-
-
-
-
- Source:
-
-
-
-
-def initialize(backtrace_cleaner, exception)
- @backtrace_cleaner = backtrace_cleaner
- @exception_class_name = exception.class.name
- @wrapped_causes = wrapped_causes_for(exception, backtrace_cleaner)
- @exception = exception
- if exception.is_a?(SyntaxError)
- @exception = ActiveSupport::SyntaxErrorProxy.new(exception)
- end
- @backtrace = build_backtrace
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 48
+ def initialize(backtrace_cleaner, exception)
+ @backtrace_cleaner = backtrace_cleaner
+ @exception_class_name = exception.class.name
+ @wrapped_causes = wrapped_causes_for(exception, backtrace_cleaner)
+ @exception = exception
+ if exception.is_a?(SyntaxError)
+ @exception = ActiveSupport::SyntaxErrorProxy.new(exception)
+ end
+ @backtrace = build_backtrace
+ end
+
+ See on GitHub
+
+
+
+
@@ -284,22 +284,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 173
+ def self.status_code_for_exception(class_name)
+ Rack::Utils.status_code(@@rescue_responses[class_name])
+ end
-
- Source:
-
-
-
-
-def self.status_code_for_exception(class_name)
- Rack::Utils.status_code(@@rescue_responses[class_name])
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -323,22 +323,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 99
+ def actions
+ ActiveSupport::ActionableError.actions(@exception)
+ end
-
- Source:
-
-
-
-
-def actions
- ActiveSupport::ActionableError.actions(@exception)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -358,26 +358,26 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 111
+ def annotated_source_code
+ if exception.respond_to?(:annotated_source_code)
+ exception.annotated_source_code
+ else
+ []
+ end
+ end
-
- Source:
-
-
-
-
-def annotated_source_code
- if exception.respond_to?(:annotated_source_code)
- exception.annotated_source_code
- else
- []
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -397,22 +397,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 133
+ def application_trace
+ clean_backtrace(:silent)
+ end
-
- Source:
-
-
-
-
-def application_trace
- clean_backtrace(:silent)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -432,22 +432,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 87
+ def corrections
+ @exception.corrections
+ end
-
- Source:
-
-
-
-
-def corrections
- @exception.corrections
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -467,23 +467,23 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 210
+ def error_highlight_available?
+ # ErrorHighlight.spot with backtrace_location keyword is available since error_highlight 0.4.0
+ defined?(ErrorHighlight) && Gem::Version.new(ErrorHighlight::VERSION) >= Gem::Version.new("0.4.0")
+ end
-
- Source:
-
-
-
-
-def error_highlight_available?
-
- defined?(ErrorHighlight) && Gem::Version.new(ErrorHighlight::VERSION) >= Gem::Version.new("0.4.0")
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -503,22 +503,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 239
+ def exception_id
+ exception.object_id
+ end
-
- Source:
-
-
-
-
-def exception_id
- exception.object_id
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -538,22 +538,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 235
+ def exception_inspect
+ exception.inspect
+ end
-
- Source:
-
-
-
-
-def exception_inspect
- exception.inspect
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -573,22 +573,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 227
+ def exception_name
+ exception.cause.class.to_s
+ end
-
- Source:
-
-
-
-
-def exception_name
- exception.cause.class.to_s
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -608,24 +608,24 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 127
+ def exception_trace
+ trace = application_trace
+ trace = framework_trace if trace.empty? && !silent_exceptions.include?(@exception_class_name)
+ trace
+ end
-
- Source:
-
-
-
-
-def exception_trace
- trace = application_trace
- trace = framework_trace if trace.empty? && !silent_exceptions.include?(@exception_class_name)
- trace
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -645,22 +645,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 75
+ def failures
+ @exception.failures
+ end
-
- Source:
-
-
-
-
-def failures
- @exception.failures
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -680,22 +680,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 91
+ def file_name
+ @exception.file_name
+ end
-
- Source:
-
-
-
-
-def file_name
- @exception.file_name
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -715,22 +715,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 137
+ def framework_trace
+ clean_backtrace(:noise)
+ end
-
- Source:
-
-
-
-
-def framework_trace
- clean_backtrace(:noise)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -750,22 +750,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 141
+ def full_trace
+ clean_backtrace(:all)
+ end
-
- Source:
-
-
-
-
-def full_trace
- clean_backtrace(:all)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -785,22 +785,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 71
+ def has_cause?
+ @exception.cause
+ end
-
- Source:
-
-
-
-
-def has_cause?
- @exception.cause
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -820,22 +820,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 79
+ def has_corrections?
+ @exception.respond_to?(:original_message) && @exception.respond_to?(:corrections)
+ end
-
- Source:
-
-
-
-
-def has_corrections?
- @exception.respond_to?(:original_message) && @exception.respond_to?(:corrections)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -855,22 +855,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 95
+ def line_number
+ @exception.line_number
+ end
-
- Source:
-
-
-
-
-def line_number
- @exception.line_number
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -890,22 +890,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 231
+ def message
+ exception.message
+ end
-
- Source:
-
-
-
-
-def message
- exception.message
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -925,22 +925,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 83
+ def original_message
+ @exception.original_message
+ end
-
- Source:
-
-
-
-
-def original_message
- @exception.original_message
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -960,22 +960,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 200
+ def rescue_response?
+ @@rescue_responses.key?(exception.class.name)
+ end
-
- Source:
-
-
-
-
-def rescue_response?
- @@rescue_responses.key?(exception.class.name)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -995,22 +995,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 119
+ def rescue_template
+ @@rescue_templates[@exception_class_name]
+ end
-
- Source:
-
-
-
-
-def rescue_template
- @@rescue_templates[@exception_class_name]
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1030,22 +1030,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 59
+ def routing_error?
+ @exception.is_a?(ActionController::RoutingError)
+ end
-
- Source:
-
-
-
-
-def routing_error?
- @exception.is_a?(ActionController::RoutingError)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1065,41 +1065,41 @@
-
-
-
-
- Source:
-
-
-
-
-def show?(request)
-
-
-
- config = request.get_header("action_dispatch.show_exceptions")
+
+
+
+ Source code
+
-
- case config
- when :none
- false
- when :rescuable
- rescue_response?
- when true
- ActionDispatch.deprecator.warn("Setting action_dispatch.show_exceptions to true is deprecated. Set to :all instead.")
- true
- when false
- ActionDispatch.deprecator.warn("Setting action_dispatch.show_exceptions to false is deprecated. Set to :none instead.")
- false
- else
- true
- end
-end
-
-
-
-
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 177
+ def show?(request)
+ # We're treating `nil` as "unset", and we want the default setting to be
+ # `:all`. This logic should be extracted to `env_config` and calculated
+ # once.
+ config = request.get_header("action_dispatch.show_exceptions")
+
+ # Include true and false for backwards compatibility.
+ case config
+ when :none
+ false
+ when :rescuable
+ rescue_response?
+ when true
+ ActionDispatch.deprecator.warn("Setting action_dispatch.show_exceptions to true is deprecated. Set to :all instead.")
+ true
+ when false
+ ActionDispatch.deprecator.warn("Setting action_dispatch.show_exceptions to false is deprecated. Set to :none instead.")
+ false
+ else
+ true
+ end
+ end
+
+ See on GitHub
+
+
+
+
+ See on GitHub
+
+
+
+
@@ -1156,22 +1156,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 223
+ def source_to_show_id
+ (traces[trace_to_show].first || {})[:id]
+ end
-
- Source:
-
-
-
-
-def source_to_show_id
- (traces[trace_to_show].first || {})[:id]
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1191,22 +1191,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 123
+ def status_code
+ self.class.status_code_for_exception(unwrapped_exception.class.name)
+ end
-
- Source:
-
-
-
-
-def status_code
- self.class.status_code_for_exception(unwrapped_exception.class.name)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1226,22 +1226,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 67
+ def sub_template_message
+ @exception.sub_template_message
+ end
-
- Source:
-
-
-
-
-def sub_template_message
- @exception.sub_template_message
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1261,22 +1261,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 63
+ def template_error?
+ @exception.is_a?(ActionView::Template::Error)
+ end
-
- Source:
-
-
-
-
-def template_error?
- @exception.is_a?(ActionView::Template::Error)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1296,26 +1296,26 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 215
+ def trace_to_show
+ if traces["Application Trace"].empty? && rescue_template != "routing_error"
+ "Full Trace"
+ else
+ "Application Trace"
+ end
+ end
-
- Source:
-
-
-
-
-def trace_to_show
- if traces["Application Trace"].empty? && rescue_template != "routing_error"
- "Full Trace"
- else
- "Application Trace"
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1335,46 +1335,46 @@
-
-
-
-
- Source:
-
-
-
-
-def traces
- application_trace_with_ids = []
- framework_trace_with_ids = []
- full_trace_with_ids = []
+
+
+
+ Source code
+
- full_trace.each_with_index do |trace, idx|
- trace_with_id = {
- exception_object_id: @exception.object_id,
- id: idx,
- trace: trace
- }
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 145
+ def traces
+ application_trace_with_ids = []
+ framework_trace_with_ids = []
+ full_trace_with_ids = []
- if application_trace.include?(trace)
- application_trace_with_ids << trace_with_id
- else
- framework_trace_with_ids << trace_with_id
- end
+ full_trace.each_with_index do |trace, idx|
+ trace_with_id = {
+ exception_object_id: @exception.object_id,
+ id: idx,
+ trace: trace
+ }
- full_trace_with_ids << trace_with_id
- end
+ if application_trace.include?(trace)
+ application_trace_with_ids << trace_with_id
+ else
+ framework_trace_with_ids << trace_with_id
+ end
- {
- "Application Trace" => application_trace_with_ids,
- "Framework Trace" => framework_trace_with_ids,
- "Full Trace" => full_trace_with_ids
- }
-end
-
-
-
-
+ full_trace_with_ids << trace_with_id
+ end
+
+ {
+ "Application Trace" => application_trace_with_ids,
+ "Framework Trace" => framework_trace_with_ids,
+ "Full Trace" => full_trace_with_ids
+ }
+ end
+
+ See on GitHub
+
+
+
+
@@ -1394,26 +1394,26 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 103
+ def unwrapped_exception
+ if wrapper_exceptions.include?(@exception_class_name)
+ @exception.cause
+ else
+ @exception
+ end
+ end
-
- Source:
-
-
-
-
-def unwrapped_exception
- if wrapper_exceptions.include?(@exception_class_name)
- @exception.cause
- else
- @exception
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/Executor.html b/src/classes/ActionDispatch/Executor.html
index 79b5d16fda..c22a52a333 100644
--- a/src/classes/ActionDispatch/Executor.html
+++ b/src/classes/ActionDispatch/Executor.html
@@ -84,22 +84,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/executor.rb, line 7
+ def initialize(app, executor)
+ @app, @executor = app, executor
+ end
-
- Source:
-
-
-
-
-def initialize(app, executor)
- @app, @executor = app, executor
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -123,31 +123,31 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/executor.rb, line 11
+ def call(env)
+ state = @executor.run!(reset: true)
+ begin
+ response = @app.call(env)
+ returned = response << ::Rack::BodyProxy.new(response.pop) { state.complete! }
+ rescue => error
+ @executor.error_reporter.report(error, handled: false, source: "application.action_dispatch")
+ raise
+ ensure
+ state.complete! unless returned
+ end
+ end
-
- Source:
-
-
-
-
-def call(env)
- state = @executor.run!(reset: true)
- begin
- response = @app.call(env)
- returned = response << ::Rack::BodyProxy.new(response.pop) { state.complete! }
- rescue => error
- @executor.error_reporter.report(error, handled: false, source: "application.action_dispatch")
- raise
- ensure
- state.complete! unless returned
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/FileHandler.html b/src/classes/ActionDispatch/FileHandler.html
index b270e652a4..b1958c0c1a 100644
--- a/src/classes/ActionDispatch/FileHandler.html
+++ b/src/classes/ActionDispatch/FileHandler.html
@@ -126,28 +126,28 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/static.rb, line 53
+ def initialize(root, index: "index", headers: {}, precompressed: %i[ br gzip ], compressible_content_types: /\A(?:text\/|application\/javascript)/)
+ @root = root.chomp("/").b
+ @index = index
+
+ @precompressed = Array(precompressed).map(&:to_s) | %w[ identity ]
+ @compressible_content_types = compressible_content_types
+
+ @file_server = ::Rack::Files.new(@root, headers)
+ end
-
- Source:
-
-
-
-
-def initialize(root, index: "index", headers: {}, precompressed: %i[ br gzip ], compressible_content_types: /\A(?:text\/|application\/javascript)/)
- @root = root.chomp("/").b
- @index = index
-
- @precompressed = Array(precompressed).map(&:to_s) | %w[ identity ]
- @compressible_content_types = compressible_content_types
-
- @file_server = ::Rack::Files.new(@root, headers)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -171,28 +171,28 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/static.rb, line 67
+ def attempt(env)
+ request = Rack::Request.new env
+
+ if request.get? || request.head?
+ if found = find_file(request.path_info, accept_encoding: request.accept_encoding)
+ serve request, *found
+ end
+ end
+ end
-
- Source:
-
-
-
-
-def attempt(env)
- request = Rack::Request.new env
-
- if request.get? || request.head?
- if found = find_file(request.path_info, accept_encoding: request.accept_encoding)
- serve request, *found
- end
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -212,22 +212,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/static.rb, line 63
+ def call(env)
+ attempt(env) || @file_server.call(env)
+ end
-
- Source:
-
-
-
-
-def call(env)
- attempt(env) || @file_server.call(env)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/Flash.html b/src/classes/ActionDispatch/Flash.html
index 2434eebc67..a7dda06843 100644
--- a/src/classes/ActionDispatch/Flash.html
+++ b/src/classes/ActionDispatch/Flash.html
@@ -158,20 +158,20 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/flash.rb, line 300
+ def self.new(app) app; end
-
- Source:
-
-
-
-
-def self.new(app) app; end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/Flash/FlashHash.html b/src/classes/ActionDispatch/Flash/FlashHash.html
index d74992ce74..ed1b06715d 100644
--- a/src/classes/ActionDispatch/Flash/FlashHash.html
+++ b/src/classes/ActionDispatch/Flash/FlashHash.html
@@ -167,22 +167,22 @@
-
-
-
-
- Source:
-
-
-
-
-def [](k)
- @flashes[k.to_s]
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/flash.rb, line 162
+ def [](k)
+ @flashes[k.to_s]
+ end
+
+ See on GitHub
+
+
+
+
@@ -202,24 +202,24 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/flash.rb, line 156
+ def []=(k, v)
+ k = k.to_s
+ @discard.delete k
+ @flashes[k] = v
+ end
-
- Source:
-
-
-
-
-def []=(k, v)
- k = k.to_s
- @discard.delete k
- @flashes[k] = v
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -239,22 +239,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/flash.rb, line 268
+ def alert
+ self[:alert]
+ end
-
- Source:
-
-
-
-
-def alert
- self[:alert]
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -274,22 +274,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/flash.rb, line 273
+ def alert=(message)
+ self[:alert] = message
+ end
-
- Source:
-
-
-
-
-def alert=(message)
- self[:alert] = message
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -309,23 +309,23 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/flash.rb, line 197
+ def clear
+ @discard.clear
+ @flashes.clear
+ end
-
- Source:
-
-
-
-
-def clear
- @discard.clear
- @flashes.clear
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -345,25 +345,25 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/flash.rb, line 182
+ def delete(key)
+ key = key.to_s
+ @discard.delete key
+ @flashes.delete key
+ self
+ end
-
- Source:
-
-
-
-
-def delete(key)
- key = key.to_s
- @discard.delete key
- @flashes.delete key
- self
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -389,24 +389,24 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/flash.rb, line 253
+ def discard(k = nil)
+ k = k.to_s if k
+ @discard.merge Array(k || keys)
+ k ? self[k] : self
+ end
-
- Source:
-
-
-
-
-def discard(k = nil)
- k = k.to_s if k
- @discard.merge Array(k || keys)
- k ? self[k] : self
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -426,22 +426,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/flash.rb, line 202
+ def each(&block)
+ @flashes.each(&block)
+ end
-
- Source:
-
-
-
-
-def each(&block)
- @flashes.each(&block)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -461,22 +461,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/flash.rb, line 193
+ def empty?
+ @flashes.empty?
+ end
-
- Source:
-
-
-
-
-def empty?
- @flashes.empty?
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -496,26 +496,26 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/flash.rb, line 148
+ def initialize_copy(other)
+ if other.now_is_loaded?
+ @now = other.now.dup
+ @now.flash = self
+ end
+ super
+ end
-
- Source:
-
-
-
-
-def initialize_copy(other)
- if other.now_is_loaded?
- @now = other.now.dup
- @now.flash = self
- end
- super
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -539,24 +539,24 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/flash.rb, line 240
+ def keep(k = nil)
+ k = k.to_s if k
+ @discard.subtract Array(k || keys)
+ k ? self[k] : self
+ end
-
- Source:
-
-
-
-
-def keep(k = nil)
- k = k.to_s if k
- @discard.subtract Array(k || keys)
- k ? self[k] : self
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -576,22 +576,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/flash.rb, line 176
+ def key?(name)
+ @flashes.key? name.to_s
+ end
-
- Source:
-
-
-
-
-def key?(name)
- @flashes.key? name.to_s
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -611,22 +611,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/flash.rb, line 172
+ def keys
+ @flashes.keys
+ end
-
- Source:
-
-
-
-
-def keys
- @flashes.keys
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -646,22 +646,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/flash.rb, line 278
+ def notice
+ self[:notice]
+ end
-
- Source:
-
-
-
-
-def notice
- self[:notice]
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -681,22 +681,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/flash.rb, line 283
+ def notice=(message)
+ self[:notice] = message
+ end
-
- Source:
-
-
-
-
-def notice=(message)
- self[:notice] = message
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -732,22 +732,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/flash.rb, line 232
+ def now
+ @now ||= FlashNow.new(self)
+ end
-
- Source:
-
-
-
-
-def now
- @now ||= FlashNow.new(self)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -767,22 +767,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/flash.rb, line 189
+ def to_hash
+ @flashes.dup
+ end
-
- Source:
-
-
-
-
-def to_hash
- @flashes.dup
-end
-
-
-
-
+ See on GitHub
+
+
+
+
Instance Protected methods
@@ -805,22 +805,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/flash.rb, line 288
+ def now_is_loaded?
+ @now
+ end
-
- Source:
-
-
-
-
-def now_is_loaded?
- @now
-end
-
-
-
-
+ See on GitHub
+
+
+
+
Instance Private methods
@@ -843,24 +843,24 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/flash.rb, line 293
+ def stringify_array(array) # :doc:
+ array.map do |item|
+ item.kind_of?(Symbol) ? item.to_s : item
+ end
+ end
-
- Source:
-
-
-
-
-def stringify_array(array)
- array.map do |item|
- item.kind_of?(Symbol) ? item.to_s : item
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/Flash/RequestMethods.html b/src/classes/ActionDispatch/Flash/RequestMethods.html
index 93c96787bf..378ce89a82 100644
--- a/src/classes/ActionDispatch/Flash/RequestMethods.html
+++ b/src/classes/ActionDispatch/Flash/RequestMethods.html
@@ -81,24 +81,24 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/flash.rb, line 50
+ def flash
+ flash = flash_hash
+ return flash if flash
+ self.flash = Flash::FlashHash.from_session_value(session["flash"])
+ end
-
- Source:
-
-
-
-
-def flash
- flash = flash_hash
- return flash if flash
- self.flash = Flash::FlashHash.from_session_value(session["flash"])
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -118,22 +118,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/flash.rb, line 56
+ def flash=(flash)
+ set_header Flash::KEY, flash
+ end
-
- Source:
-
-
-
-
-def flash=(flash)
- set_header Flash::KEY, flash
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/HostAuthorization.html b/src/classes/ActionDispatch/HostAuthorization.html
index 0babef6459..063a7d5744 100644
--- a/src/classes/ActionDispatch/HostAuthorization.html
+++ b/src/classes/ActionDispatch/HostAuthorization.html
@@ -119,26 +119,26 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/host_authorization.rb, line 125
+ def initialize(app, hosts, exclude: nil, response_app: nil)
+ @app = app
+ @permissions = Permissions.new(hosts)
+ @exclude = exclude
+
+ @response_app = response_app || DefaultResponseApp.new
+ end
-
- Source:
-
-
-
-
-def initialize(app, hosts, exclude: nil, response_app: nil)
- @app = app
- @permissions = Permissions.new(hosts)
- @exclude = exclude
-
- @response_app = response_app || DefaultResponseApp.new
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -162,33 +162,33 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/host_authorization.rb, line 133
+ def call(env)
+ return @app.call(env) if @permissions.empty?
+
+ request = Request.new(env)
+ hosts = blocked_hosts(request)
+
+ if hosts.empty? || excluded?(request)
+ mark_as_authorized(request)
+ @app.call(env)
+ else
+ env["action_dispatch.blocked_hosts"] = hosts
+ @response_app.call(env)
+ end
+ end
-
- Source:
-
-
-
-
-def call(env)
- return @app.call(env) if @permissions.empty?
-
- request = Request.new(env)
- hosts = blocked_hosts(request)
-
- if hosts.empty? || excluded?(request)
- mark_as_authorized(request)
- @app.call(env)
- else
- env["action_dispatch.blocked_hosts"] = hosts
- @response_app.call(env)
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/Http/Cache/Request.html b/src/classes/ActionDispatch/Http/Cache/Request.html
index 1244475836..7382d852be 100644
--- a/src/classes/ActionDispatch/Http/Cache/Request.html
+++ b/src/classes/ActionDispatch/Http/Cache/Request.html
@@ -125,25 +125,25 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/cache.rb, line 28
+ def etag_matches?(etag)
+ if etag
+ validators = if_none_match_etags
+ validators.include?(etag) || validators.include?("*")
+ end
+ end
-
- Source:
-
-
-
-
-def etag_matches?(etag)
- if etag
- validators = if_none_match_etags
- validators.include?(etag) || validators.include?("*")
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -163,30 +163,30 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/cache.rb, line 38
+ def fresh?(response)
+ last_modified = if_modified_since
+ etag = if_none_match
+
+ return false unless last_modified || etag
+
+ success = true
+ success &&= not_modified?(response.last_modified) if last_modified
+ success &&= etag_matches?(response.etag) if etag
+ success
+ end
-
- Source:
-
-
-
-
-def fresh?(response)
- last_modified = if_modified_since
- etag = if_none_match
-
- return false unless last_modified || etag
-
- success = true
- success &&= not_modified?(response.last_modified) if last_modified
- success &&= etag_matches?(response.etag) if etag
- success
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -206,24 +206,24 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/cache.rb, line 10
+ def if_modified_since
+ if since = get_header(HTTP_IF_MODIFIED_SINCE)
+ Time.rfc2822(since) rescue nil
+ end
+ end
-
- Source:
-
-
-
-
-def if_modified_since
- if since = get_header(HTTP_IF_MODIFIED_SINCE)
- Time.rfc2822(since) rescue nil
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -243,22 +243,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/cache.rb, line 16
+ def if_none_match
+ get_header HTTP_IF_NONE_MATCH
+ end
-
- Source:
-
-
-
-
-def if_none_match
- get_header HTTP_IF_NONE_MATCH
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -278,22 +278,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/cache.rb, line 20
+ def if_none_match_etags
+ if_none_match ? if_none_match.split(",").each(&:strip!) : []
+ end
-
- Source:
-
-
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -313,22 +313,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/cache.rb, line 24
+ def not_modified?(modified_at)
+ if_modified_since && modified_at && if_modified_since >= modified_at
+ end
-
- Source:
-
-
-
-
-def not_modified?(modified_at)
- if_modified_since && modified_at && if_modified_since >= modified_at
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/Http/Cache/Response.html b/src/classes/ActionDispatch/Http/Cache/Response.html
index ac4f9aa30f..3d39afe18a 100644
--- a/src/classes/ActionDispatch/Http/Cache/Response.html
+++ b/src/classes/ActionDispatch/Http/Cache/Response.html
@@ -247,24 +247,24 @@
-
-
-
-
- Source:
-
-
-
-
-def date
- if date_header = get_header(DATE)
- Time.httpdate(date_header)
- end
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/cache.rb, line 68
+ def date
+ if date_header = get_header(DATE)
+ Time.httpdate(date_header)
+ end
+ end
+
+ See on GitHub
+
+
+
+
@@ -284,22 +284,22 @@
-
-
-
-
- Source:
-
-
-
-
-def date=(utc_time)
- set_header DATE, utc_time.httpdate
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/cache.rb, line 78
+ def date=(utc_time)
+ set_header DATE, utc_time.httpdate
+ end
+
+ See on GitHub
+
+
+
+
@@ -319,22 +319,22 @@
-
-
-
-
- Source:
-
-
-
-
-def date?
- has_header? DATE
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/cache.rb, line 74
+ def date?
+ has_header? DATE
+ end
+
+ See on GitHub
+
+
+
+
@@ -360,22 +360,22 @@
-
-
-
-
- Source:
-
-
-
-
-def etag=(weak_validators)
- self.weak_etag = weak_validators
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/cache.rb, line 101
+ def etag=(weak_validators)
+ self.weak_etag = weak_validators
+ end
+
+ See on GitHub
+
+
+
+
@@ -395,20 +395,20 @@
-
-
-
-
- Source:
-
-
-
-
-def etag?; etag; end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/cache.rb, line 113
+ def etag?; etag; end
+
+ See on GitHub
+
+
+
+
@@ -428,24 +428,24 @@
-
-
-
-
- Source:
-
-
-
-
-def last_modified
- if last = get_header(LAST_MODIFIED)
- Time.httpdate(last)
- end
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/cache.rb, line 54
+ def last_modified
+ if last = get_header(LAST_MODIFIED)
+ Time.httpdate(last)
+ end
+ end
+
+ See on GitHub
+
+
+
+
@@ -465,22 +465,22 @@
-
-
-
-
- Source:
-
-
-
-
-def last_modified=(utc_time)
- set_header LAST_MODIFIED, utc_time.httpdate
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/cache.rb, line 64
+ def last_modified=(utc_time)
+ set_header LAST_MODIFIED, utc_time.httpdate
+ end
+
+ See on GitHub
+
+
+
+
@@ -500,22 +500,22 @@
-
-
-
-
- Source:
-
-
-
-
-def last_modified?
- has_header? LAST_MODIFIED
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/cache.rb, line 60
+ def last_modified?
+ has_header? LAST_MODIFIED
+ end
+
+ See on GitHub
+
+
+
+
@@ -535,22 +535,22 @@
-
-
-
-
- Source:
-
-
-
-
-def strong_etag=(strong_validators)
- set_header "ETag", generate_strong_etag(strong_validators)
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/cache.rb, line 109
+ def strong_etag=(strong_validators)
+ set_header "ETag", generate_strong_etag(strong_validators)
+ end
+
+ See on GitHub
+
+
+
+
@@ -570,22 +570,22 @@
-
-
-
-
- Source:
-
-
-
-
-def strong_etag?
- etag? && !weak_etag?
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/cache.rb, line 121
+ def strong_etag?
+ etag? && !weak_etag?
+ end
+
+ See on GitHub
+
+
+
+
@@ -605,22 +605,22 @@
-
-
-
-
- Source:
-
-
-
-
-def weak_etag=(weak_validators)
- set_header "ETag", generate_weak_etag(weak_validators)
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/cache.rb, line 105
+ def weak_etag=(weak_validators)
+ set_header "ETag", generate_weak_etag(weak_validators)
+ end
+
+ See on GitHub
+
+
+
+
@@ -640,22 +640,22 @@
-
-
-
-
- Source:
-
-
-
-
-def weak_etag?
- etag? && etag.start_with?('W/"')
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/cache.rb, line 116
+ def weak_etag?
+ etag? && etag.start_with?('W/"')
+ end
+
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/Http/FilterParameters.html b/src/classes/ActionDispatch/Http/FilterParameters.html
index ee65fe0e9e..ad9bf3f4ce 100644
--- a/src/classes/ActionDispatch/Http/FilterParameters.html
+++ b/src/classes/ActionDispatch/Http/FilterParameters.html
@@ -146,26 +146,26 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/filter_parameters.rb, line 21
+ def initialize
+ super
+ @filtered_parameters = nil
+ @filtered_env = nil
+ @filtered_path = nil
+ @parameter_filter = nil
+ end
-
- Source:
-
-
-
-
-def initialize
- super
- @filtered_parameters = nil
- @filtered_env = nil
- @filtered_path = nil
- @parameter_filter = nil
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -189,22 +189,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/filter_parameters.rb, line 37
+ def filtered_env
+ @filtered_env ||= env_filter.filter(@env)
+ end
-
- Source:
-
-
-
-
-def filtered_env
- @filtered_env ||= env_filter.filter(@env)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -224,24 +224,24 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/filter_parameters.rb, line 30
+ def filtered_parameters
+ @filtered_parameters ||= parameter_filter.filter(parameters)
+ rescue ActionDispatch::Http::Parameters::ParseError
+ @filtered_parameters = {}
+ end
-
- Source:
-
-
-
-
-def filtered_parameters
- @filtered_parameters ||= parameter_filter.filter(parameters)
-rescue ActionDispatch::Http::Parameters::ParseError
- @filtered_parameters = {}
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -261,22 +261,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/filter_parameters.rb, line 42
+ def filtered_path
+ @filtered_path ||= query_string.empty? ? path : "#{path}?#{filtered_query_string}"
+ end
-
- Source:
-
-
-
-
-def filtered_path
- @filtered_path ||= query_string.empty? ? path : "#{path}?#{filtered_query_string}"
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -296,26 +296,26 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/filter_parameters.rb, line 47
+ def parameter_filter
+ @parameter_filter ||= if has_header?("action_dispatch.parameter_filter")
+ parameter_filter_for get_header("action_dispatch.parameter_filter")
+ else
+ NULL_PARAM_FILTER
+ end
+ end
-
- Source:
-
-
-
-
-def parameter_filter
- @parameter_filter ||= if has_header?("action_dispatch.parameter_filter")
- parameter_filter_for get_header("action_dispatch.parameter_filter")
- else
- NULL_PARAM_FILTER
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
Instance Private methods
@@ -338,25 +338,25 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/filter_parameters.rb, line 56
+ def env_filter # :doc:
+ user_key = fetch_header("action_dispatch.parameter_filter") {
+ return NULL_ENV_FILTER
+ }
+ parameter_filter_for(Array(user_key) + ENV_MATCH)
+ end
-
- Source:
-
-
-
-
-def env_filter
- user_key = fetch_header("action_dispatch.parameter_filter") {
- return NULL_ENV_FILTER
- }
- parameter_filter_for(Array(user_key) + ENV_MATCH)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -376,24 +376,24 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/filter_parameters.rb, line 69
+ def filtered_query_string # :doc:
+ query_string.gsub(PAIR_RE) do |_|
+ parameter_filter.filter($1 => $2).first.join("=")
+ end
+ end
-
- Source:
-
-
-
-
-def filtered_query_string
- query_string.gsub(PAIR_RE) do |_|
- parameter_filter.filter($1 => $2).first.join("=")
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -413,22 +413,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/filter_parameters.rb, line 63
+ def parameter_filter_for(filters) # :doc:
+ ActiveSupport::ParameterFilter.new(filters)
+ end
-
- Source:
-
-
-
-
-def parameter_filter_for(filters)
- ActiveSupport::ParameterFilter.new(filters)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/Http/Headers.html b/src/classes/ActionDispatch/Http/Headers.html
index 4bace6b43c..856ea32edf 100644
--- a/src/classes/ActionDispatch/Http/Headers.html
+++ b/src/classes/ActionDispatch/Http/Headers.html
@@ -208,22 +208,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/headers.rb, line 52
+ def self.from_hash(hash)
+ new ActionDispatch::Request.new hash
+ end
-
- Source:
-
-
-
-
-def self.from_hash(hash)
- new ActionDispatch::Request.new hash
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -247,22 +247,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/headers.rb, line 61
+ def [](key)
+ @req.get_header env_name(key)
+ end
-
- Source:
-
-
-
-
-def [](key)
- @req.get_header env_name(key)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -282,22 +282,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/headers.rb, line 66
+ def []=(key, value)
+ @req.set_header env_name(key), value
+ end
-
- Source:
-
-
-
-
-def []=(key, value)
- @req.set_header env_name(key), value
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -317,22 +317,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/headers.rb, line 71
+ def add(key, value)
+ @req.add_header env_name(key), value
+ end
-
- Source:
-
-
-
-
-def add(key, value)
- @req.add_header env_name(key), value
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -352,22 +352,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/headers.rb, line 97
+ def each(&block)
+ @req.each_header(&block)
+ end
-
- Source:
-
-
-
-
-def each(&block)
- @req.each_header(&block)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -387,20 +387,20 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/headers.rb, line 118
+ def env; @req.env.dup; end
-
- Source:
-
-
-
-
-def env; @req.env.dup; end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -424,26 +424,26 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/headers.rb, line 89
+ def fetch(key, default = DEFAULT)
+ @req.fetch_header(env_name(key)) do
+ return default unless default == DEFAULT
+ return yield if block_given?
+ raise KeyError, key
+ end
+ end
-
- Source:
-
-
-
-
-def fetch(key, default = DEFAULT)
- @req.fetch_header(env_name(key)) do
- return default unless default == DEFAULT
- return yield if block_given?
- raise KeyError, key
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -467,7 +467,8 @@
-
+
+
@@ -491,22 +492,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/headers.rb, line 75
+ def key?(key)
+ @req.has_header? env_name(key)
+ end
-
- Source:
-
-
-
-
-def key?(key)
- @req.has_header? env_name(key)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -526,24 +527,24 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/headers.rb, line 103
+ def merge(headers_or_env)
+ headers = @req.dup.headers
+ headers.merge!(headers_or_env)
+ headers
+ end
-
- Source:
-
-
-
-
-def merge(headers_or_env)
- headers = @req.dup.headers
- headers.merge!(headers_or_env)
- headers
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -563,24 +564,24 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/headers.rb, line 112
+ def merge!(headers_or_env)
+ headers_or_env.each do |key, value|
+ @req.set_header env_name(key), value
+ end
+ end
-
- Source:
-
-
-
-
-def merge!(headers_or_env)
- headers_or_env.each do |key, value|
- @req.set_header env_name(key), value
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/Http/MimeNegotiation.html b/src/classes/ActionDispatch/Http/MimeNegotiation.html
index 9fd885faa8..c9a9b7a775 100644
--- a/src/classes/ActionDispatch/Http/MimeNegotiation.html
+++ b/src/classes/ActionDispatch/Http/MimeNegotiation.html
@@ -165,33 +165,33 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/mime_negotiation.rb, line 54
+ def accepts
+ fetch_header("action_dispatch.request.accepts") do |k|
+ header = get_header("HTTP_ACCEPT").to_s.strip
+
+ v = if header.empty?
+ [content_mime_type]
+ else
+ Mime::Type.parse(header)
+ end
+ set_header k, v
+ rescue ::Mime::Type::InvalidMimeType => e
+ raise InvalidType, e.message
+ end
+ end
-
- Source:
-
-
-
-
-def accepts
- fetch_header("action_dispatch.request.accepts") do |k|
- header = get_header("HTTP_ACCEPT").to_s.strip
-
- v = if header.empty?
- [content_mime_type]
- else
- Mime::Type.parse(header)
- end
- set_header k, v
- rescue ::Mime::Type::InvalidMimeType => e
- raise InvalidType, e.message
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -211,31 +211,31 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/mime_negotiation.rb, line 36
+ def content_mime_type
+ fetch_header("action_dispatch.request.content_type") do |k|
+ v = if get_header("CONTENT_TYPE") =~ /^([^,;]*)/
+ Mime::Type.lookup($1.strip.downcase)
+ else
+ nil
+ end
+ set_header k, v
+ rescue ::Mime::Type::InvalidMimeType => e
+ raise InvalidType, e.message
+ end
+ end
-
- Source:
-
-
-
-
-def content_mime_type
- fetch_header("action_dispatch.request.content_type") do |k|
- v = if get_header("CONTENT_TYPE") =~ /^([^,;]*)/
- Mime::Type.lookup($1.strip.downcase)
- else
- nil
- end
- set_header k, v
- rescue ::Mime::Type::InvalidMimeType => e
- raise InvalidType, e.message
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -260,22 +260,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/mime_negotiation.rb, line 75
+ def format(_view_path = nil)
+ formats.first || Mime::NullType.instance
+ end
-
- Source:
-
-
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -305,23 +305,23 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/mime_negotiation.rb, line 127
+ def format=(extension)
+ parameters[:format] = extension.to_s
+ set_header "action_dispatch.request.formats", [Mime::Type.lookup_by_extension(parameters[:format])]
+ end
-
- Source:
-
-
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -341,40 +341,40 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/mime_negotiation.rb, line 79
+ def formats
+ fetch_header("action_dispatch.request.formats") do |k|
+ v = if params_readable?
+ Array(Mime[parameters[:format]])
+ elsif use_accept_header && valid_accept_header
+ accepts.dup
+ elsif extension_format = format_from_path_extension
+ [extension_format]
+ elsif xhr?
+ [Mime[:js]]
+ else
+ [Mime[:html]]
+ end
+
+ v.select! do |format|
+ format.symbol || format.ref == "*/*"
+ end
+
+ set_header k, v
+ end
+ end
-
- Source:
-
-
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -406,25 +406,25 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/mime_negotiation.rb, line 146
+ def formats=(extensions)
+ parameters[:format] = extensions.first.to_s
+ set_header "action_dispatch.request.formats", extensions.collect { |extension|
+ Mime::Type.lookup_by_extension(extension)
+ }
+ end
-
- Source:
-
-
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -444,30 +444,30 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/mime_negotiation.rb, line 154
+ def negotiate_mime(order)
+ formats.each do |priority|
+ if priority == Mime::ALL
+ return order.first
+ elsif order.include?(priority)
+ return priority
+ end
+ end
+
+ order.include?(Mime::ALL) ? format : nil
+ end
-
- Source:
-
-
-
-
-def negotiate_mime(order)
- formats.each do |priority|
- if priority == Mime::ALL
- return order.first
- elsif order.include?(priority)
- return priority
- end
- end
-
- order.include?(Mime::ALL) ? format : nil
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -487,25 +487,25 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/mime_negotiation.rb, line 27
+ def return_only_media_type_on_content_type
+ ActionDispatch.deprecator.warn(
+ "`config.action_dispatch.return_only_request_media_type_on_content_type` is deprecated and will" \
+ " be removed in Rails 7.2."
+ )
+ end
-
- Source:
-
-
-
-
-def return_only_media_type_on_content_type
- ActionDispatch.deprecator.warn(
- "`config.action_dispatch.return_only_request_media_type_on_content_type` is deprecated and will" \
- " be removed in Rails 7.2."
- )
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -525,25 +525,25 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/mime_negotiation.rb, line 20
+ def return_only_media_type_on_content_type=(value)
+ ActionDispatch.deprecator.warn(
+ "`config.action_dispatch.return_only_request_media_type_on_content_type` is deprecated and will" \
+ " be removed in Rails 7.2."
+ )
+ end
-
- Source:
-
-
-
-
-def return_only_media_type_on_content_type=(value)
- ActionDispatch.deprecator.warn(
- "`config.action_dispatch.return_only_request_media_type_on_content_type` is deprecated and will" \
- " be removed in Rails 7.2."
- )
-end
-
-
-
-
+ See on GitHub
+
+
+
+
+ See on GitHub
+
+
+
+
@@ -598,22 +598,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/mime_negotiation.rb, line 112
+ def variant
+ @variant ||= ActiveSupport::ArrayInquirer.new
+ end
-
- Source:
-
-
-
-
-def variant
- @variant ||= ActiveSupport::ArrayInquirer.new
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -633,28 +633,28 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/mime_negotiation.rb, line 102
+ def variant=(variant)
+ variant = Array(variant)
+
+ if variant.all?(Symbol)
+ @variant = ActiveSupport::ArrayInquirer.new(variant)
+ else
+ raise ArgumentError, "request.variant must be set to a Symbol or an Array of Symbols."
+ end
+ end
-
- Source:
-
-
-
-
-def variant=(variant)
- variant = Array(variant)
-
- if variant.all?(Symbol)
- @variant = ActiveSupport::ArrayInquirer.new(variant)
- else
- raise ArgumentError, "request.variant must be set to a Symbol or an Array of Symbols."
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/Http/ParameterFilter.html b/src/classes/ActionDispatch/Http/ParameterFilter.html
deleted file mode 100644
index 5d5fae4009..0000000000
--- a/src/classes/ActionDispatch/Http/ParameterFilter.html
+++ /dev/null
@@ -1,149 +0,0 @@
----
-title: ActionDispatch::Http::ParameterFilter
-layout: default
----
-
-
-
-
Ruby on Rails 5.2.5
-
-
Class
-
- ActionDispatch::Http::ParameterFilter
-
- <
-
- Object
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Methods
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Class Public methods
-
-
-
-
- new(filters = [])
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Source:
-
-
-
-
-def initialize(filters = [])
- @filters = filters
-end
-
-
-
-
-
-
-
-
Instance Public methods
-
-
-
-
- filter(params)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Source:
-
-
-
-
-def filter(params)
- compiled_filter.call(params)
-end
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/classes/ActionDispatch/Http/Parameters.html b/src/classes/ActionDispatch/Http/Parameters.html
index 934e96212e..c01a744b25 100644
--- a/src/classes/ActionDispatch/Http/Parameters.html
+++ b/src/classes/ActionDispatch/Http/Parameters.html
@@ -156,32 +156,32 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/parameters.rb, line 50
+ def parameters
+ params = get_header("action_dispatch.request.parameters")
+ return params if params
+
+ params = begin
+ request_parameters.merge(query_parameters)
+ rescue EOFError
+ query_parameters.dup
+ end
+ params.merge!(path_parameters)
+ set_header("action_dispatch.request.parameters", params)
+ params
+ end
-
- Source:
-
-
-
-
-def parameters
- params = get_header("action_dispatch.request.parameters")
- return params if params
-
- params = begin
- request_parameters.merge(query_parameters)
- rescue EOFError
- query_parameters.dup
- end
- params.merge!(path_parameters)
- set_header("action_dispatch.request.parameters", params)
- params
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -205,7 +205,8 @@
-
+
+
@@ -228,22 +229,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/parameters.rb, line 82
+ def path_parameters
+ get_header(PARAMETERS_KEY) || set_header(PARAMETERS_KEY, {})
+ end
-
- Source:
-
-
-
-
-def path_parameters
- get_header(PARAMETERS_KEY) || set_header(PARAMETERS_KEY, {})
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/Http/Parameters/ClassMethods.html b/src/classes/ActionDispatch/Http/Parameters/ClassMethods.html
index afc24132b7..e96b151c30 100644
--- a/src/classes/ActionDispatch/Http/Parameters/ClassMethods.html
+++ b/src/classes/ActionDispatch/Http/Parameters/ClassMethods.html
@@ -83,22 +83,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/parameters.rb, line 44
+ def parameter_parsers=(parsers)
+ @parameter_parsers = parsers.transform_keys { |key| key.respond_to?(:symbol) ? key.symbol : key }
+ end
-
- Source:
-
-
-
-
-def parameter_parsers=(parsers)
- @parameter_parsers = parsers.transform_keys { |key| key.respond_to?(:symbol) ? key.symbol : key }
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/Http/Parameters/ParseError.html b/src/classes/ActionDispatch/Http/Parameters/ParseError.html
index 368f5c4821..7373550117 100644
--- a/src/classes/ActionDispatch/Http/Parameters/ParseError.html
+++ b/src/classes/ActionDispatch/Http/Parameters/ParseError.html
@@ -86,22 +86,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/parameters.rb, line 20
+ def initialize(message = $!.message)
+ super(message)
+ end
-
- Source:
-
-
-
-
-def initialize(message = $!.message)
- super(message)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/Http/URL.html b/src/classes/ActionDispatch/Http/URL.html
index 5e69ed4b4e..5aa4625de2 100644
--- a/src/classes/ActionDispatch/Http/URL.html
+++ b/src/classes/ActionDispatch/Http/URL.html
@@ -202,22 +202,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/url.rb, line 22
+ def extract_domain(host, tld_length)
+ extract_domain_from(host, tld_length) if named_host?(host)
+ end
-
- Source:
-
-
-
-
-def extract_domain(host, tld_length)
- extract_domain_from(host, tld_length) if named_host?(host)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -243,22 +243,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/url.rb, line 46
+ def extract_subdomain(host, tld_length)
+ extract_subdomains(host, tld_length).join(".")
+ end
-
- Source:
-
-
-
-
-def extract_subdomain(host, tld_length)
- extract_subdomains(host, tld_length).join(".")
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -284,26 +284,26 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/url.rb, line 32
+ def extract_subdomains(host, tld_length)
+ if named_host?(host)
+ extract_subdomains_from(host, tld_length)
+ else
+ []
+ end
+ end
-
- Source:
-
-
-
-
-def extract_subdomains(host, tld_length)
- if named_host?(host)
- extract_subdomains_from(host, tld_length)
- else
- []
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -323,30 +323,30 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/url.rb, line 58
+ def full_url_for(options)
+ host = options[:host]
+ protocol = options[:protocol]
+ port = options[:port]
+
+ unless host
+ raise ArgumentError, "Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true"
+ end
+
+ build_host_url(host, port, protocol, options, path_for(options))
+ end
-
- Source:
-
-
-
-
-def full_url_for(options)
- host = options[:host]
- protocol = options[:protocol]
- port = options[:port]
-
- unless host
- raise ArgumentError, "Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true"
- end
-
- build_host_url(host, port, protocol, options, path_for(options))
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -366,24 +366,24 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/url.rb, line 179
+ def initialize
+ super
+ @protocol = nil
+ @port = nil
+ end
-
- Source:
-
-
-
-
-def initialize
- super
- @protocol = nil
- @port = nil
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -403,30 +403,30 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/url.rb, line 70
+ def path_for(options)
+ path = options[:script_name].to_s.chomp("/")
+ path << options[:path] if options.key?(:path)
+
+ path = "/" if options[:trailing_slash] && path.blank?
+
+ add_params(path, options[:params]) if options.key?(:params)
+ add_anchor(path, options[:anchor]) if options.key?(:anchor)
+
+ path
+ end
-
- Source:
-
-
-
-
-def path_for(options)
- path = options[:script_name].to_s.chomp("/")
- path << options[:path] if options.key?(:path)
-
- path = "/" if options[:trailing_slash] && path.blank?
-
- add_params(path, options[:params]) if options.key?(:params)
- add_anchor(path, options[:anchor]) if options.key?(:anchor)
-
- path
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -446,26 +446,26 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/url.rb, line 50
+ def url_for(options)
+ if options[:only_path]
+ path_for options
+ else
+ full_url_for options
+ end
+ end
-
- Source:
-
-
-
-
-def url_for(options)
- if options[:only_path]
- path_for options
- else
- full_url_for options
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -489,22 +489,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/url.rb, line 321
+ def domain(tld_length = @@tld_length)
+ ActionDispatch::Http::URL.extract_domain(host, tld_length)
+ end
-
- Source:
-
-
-
-
-def domain(tld_length = @@tld_length)
- ActionDispatch::Http::URL.extract_domain(host, tld_length)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -528,22 +528,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/url.rb, line 226
+ def host
+ raw_host_with_port.sub(/:\d+$/, "")
+ end
-
- Source:
-
-
-
-
-def host
- raw_host_with_port.sub(/:\d+$/, "")
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -573,22 +573,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/url.rb, line 242
+ def host_with_port
+ "#{host}#{port_string}"
+ end
-
- Source:
-
-
-
-
-def host_with_port
- "#{host}#{port_string}"
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -615,22 +615,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/url.rb, line 292
+ def optional_port
+ standard_port? ? nil : port
+ end
-
- Source:
-
-
-
-
-def optional_port
- standard_port? ? nil : port
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -657,26 +657,26 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/url.rb, line 253
+ def port
+ @port ||= if raw_host_with_port =~ /:(\d+)$/
+ $1.to_i
+ else
+ standard_port
+ end
+ end
-
- Source:
-
-
-
-
-def port
- @port ||= if raw_host_with_port =~ /:(\d+)$/
- $1.to_i
- else
- standard_port
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -703,22 +703,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/url.rb, line 304
+ def port_string
+ standard_port? ? "" : ":#{port}"
+ end
-
- Source:
-
-
-
-
-def port_string
- standard_port? ? "" : ":#{port}"
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -745,22 +745,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/url.rb, line 200
+ def protocol
+ @protocol ||= ssl? ? "https://" : "http://"
+ end
-
- Source:
-
-
-
-
-def protocol
- @protocol ||= ssl? ? "https://" : "http://"
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -790,26 +790,26 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/url.rb, line 214
+ def raw_host_with_port
+ if forwarded = x_forwarded_host.presence
+ forwarded.split(/,\s?/).last
+ else
+ get_header("HTTP_HOST") || "#{server_name}:#{get_header('SERVER_PORT')}"
+ end
+ end
-
- Source:
-
-
-
-
-def raw_host_with_port
- if forwarded = x_forwarded_host.presence
- forwarded.split(/,\s?/).last
- else
- get_header("HTTP_HOST") || "#{server_name}:#{get_header('SERVER_PORT')}"
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -836,22 +836,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/url.rb, line 315
+ def server_port
+ get_header("SERVER_PORT").to_i
+ end
-
- Source:
-
-
-
-
-def server_port
- get_header("SERVER_PORT").to_i
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -875,26 +875,26 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/url.rb, line 265
+ def standard_port
+ if "https://" == protocol
+ 443
+ else
+ 80
+ end
+ end
-
- Source:
-
-
-
-
-def standard_port
- if "https://" == protocol
- 443
- else
- 80
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -921,22 +921,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/url.rb, line 280
+ def standard_port?
+ port == standard_port
+ end
-
- Source:
-
-
-
-
-def standard_port?
- port == standard_port
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -956,22 +956,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/url.rb, line 337
+ def subdomain(tld_length = @@tld_length)
+ ActionDispatch::Http::URL.extract_subdomain(host, tld_length)
+ end
-
- Source:
-
-
-
-
-def subdomain(tld_length = @@tld_length)
- ActionDispatch::Http::URL.extract_subdomain(host, tld_length)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -991,22 +991,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/url.rb, line 329
+ def subdomains(tld_length = @@tld_length)
+ ActionDispatch::Http::URL.extract_subdomains(host, tld_length)
+ end
-
- Source:
-
-
-
-
-def subdomains(tld_length = @@tld_length)
- ActionDispatch::Http::URL.extract_subdomains(host, tld_length)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1030,22 +1030,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/url.rb, line 189
+ def url
+ protocol + host_with_port + fullpath
+ end
-
- Source:
-
-
-
-
-def url
- protocol + host_with_port + fullpath
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/Http/UploadedFile.html b/src/classes/ActionDispatch/Http/UploadedFile.html
index 7505d70463..3abe5ff277 100644
--- a/src/classes/ActionDispatch/Http/UploadedFile.html
+++ b/src/classes/ActionDispatch/Http/UploadedFile.html
@@ -163,22 +163,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/upload.rb, line 71
+ def close(unlink_now = false)
+ @tempfile.close(unlink_now)
+ end
-
- Source:
-
-
-
-
-def close(unlink_now = false)
- @tempfile.close(unlink_now)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -198,22 +198,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/upload.rb, line 96
+ def eof?
+ @tempfile.eof?
+ end
-
- Source:
-
-
-
-
-def eof?
- @tempfile.eof?
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -233,22 +233,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/upload.rb, line 66
+ def open
+ @tempfile.open
+ end
-
- Source:
-
-
-
-
-def open
- @tempfile.open
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -268,22 +268,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/upload.rb, line 76
+ def path
+ @tempfile.path
+ end
-
- Source:
-
-
-
-
-def path
- @tempfile.path
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -303,22 +303,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/upload.rb, line 61
+ def read(length = nil, buffer = nil)
+ @tempfile.read(length, buffer)
+ end
-
- Source:
-
-
-
-
-def read(length = nil, buffer = nil)
- @tempfile.read(length, buffer)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -338,22 +338,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/upload.rb, line 86
+ def rewind
+ @tempfile.rewind
+ end
-
- Source:
-
-
-
-
-def rewind
- @tempfile.rewind
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -373,22 +373,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/upload.rb, line 91
+ def size
+ @tempfile.size
+ end
-
- Source:
-
-
-
-
-def size
- @tempfile.size
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -408,22 +408,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/upload.rb, line 100
+ def to_io
+ @tempfile.to_io
+ end
-
- Source:
-
-
-
-
-def to_io
- @tempfile.to_io
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -443,22 +443,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/upload.rb, line 81
+ def to_path
+ @tempfile.to_path
+ end
-
- Source:
-
-
-
-
-def to_path
- @tempfile.to_path
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/Integration/RequestHelpers.html b/src/classes/ActionDispatch/Integration/RequestHelpers.html
index 3c83637634..26eaad5e68 100644
--- a/src/classes/ActionDispatch/Integration/RequestHelpers.html
+++ b/src/classes/ActionDispatch/Integration/RequestHelpers.html
@@ -103,22 +103,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/integration.rb, line 39
+ def delete(path, **args)
+ process(:delete, path, **args)
+ end
-
- Source:
-
-
-
-
-def delete(path, **args)
- process(:delete, path, **args)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -140,36 +140,36 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/integration.rb, line 63
+ def follow_redirect!(headers: {}, **args)
+ raise "not a redirect! #{status} #{status_message}" unless redirect?
+
+ method =
+ if [307, 308].include?(response.status)
+ request.method.downcase
+ else
+ :get
+ end
+
+ if [ :HTTP_REFERER, "HTTP_REFERER" ].none? { |key| headers.key? key }
+ headers["HTTP_REFERER"] = request.url
+ end
+
+ public_send(method, response.location, headers: headers, **args)
+ status
+ end
-
- Source:
-
-
-
-
-def follow_redirect!(headers: {}, **args)
- raise "not a redirect! #{status} #{status_message}" unless redirect?
-
- method =
- if [307, 308].include?(response.status)
- request.method.downcase
- else
- :get
- end
-
- if [ :HTTP_REFERER, "HTTP_REFERER" ].none? { |key| headers.key? key }
- headers["HTTP_REFERER"] = request.url
- end
-
- public_send(method, response.location, headers: headers, **args)
- status
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -189,22 +189,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/integration.rb, line 15
+ def get(path, **args)
+ process(:get, path, **args)
+ end
-
- Source:
-
-
-
-
-def get(path, **args)
- process(:get, path, **args)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -224,22 +224,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/integration.rb, line 45
+ def head(path, **args)
+ process(:head, path, **args)
+ end
-
- Source:
-
-
-
-
-def head(path, **args)
- process(:head, path, **args)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -259,22 +259,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/integration.rb, line 51
+ def options(path, **args)
+ process(:options, path, **args)
+ end
-
- Source:
-
-
-
-
-def options(path, **args)
- process(:options, path, **args)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -294,22 +294,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/integration.rb, line 27
+ def patch(path, **args)
+ process(:patch, path, **args)
+ end
-
- Source:
-
-
-
-
-def patch(path, **args)
- process(:patch, path, **args)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -329,22 +329,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/integration.rb, line 21
+ def post(path, **args)
+ process(:post, path, **args)
+ end
-
- Source:
-
-
-
-
-def post(path, **args)
- process(:post, path, **args)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -364,22 +364,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/integration.rb, line 33
+ def put(path, **args)
+ process(:put, path, **args)
+ end
-
- Source:
-
-
-
-
-def put(path, **args)
- process(:put, path, **args)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/Integration/Runner.html b/src/classes/ActionDispatch/Integration/Runner.html
index ecaf88f587..f04ea4c395 100644
--- a/src/classes/ActionDispatch/Integration/Runner.html
+++ b/src/classes/ActionDispatch/Integration/Runner.html
@@ -144,23 +144,23 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/integration.rb, line 333
+ def initialize(*args, &blk)
+ super(*args, &blk)
+ @integration_session = nil
+ end
-
- Source:
-
-
-
-
-def initialize(*args, &blk)
- super(*args, &blk)
- @integration_session = nil
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -184,30 +184,30 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/integration.rb, line 353
+ def create_session(app)
+ klass = APP_SESSIONS[app] ||= Class.new(Integration::Session) {
+ # If the app is a Rails app, make url_helpers available on the session.
+ # This makes app.url_for and app.foo_path available in the console.
+ if app.respond_to?(:routes) && app.routes.is_a?(ActionDispatch::Routing::RouteSet)
+ include app.routes.url_helpers
+ include app.routes.mounted_helpers
+ end
+ }
+ klass.new(app)
+ end
-
- Source:
-
-
-
-
-def create_session(app)
- klass = APP_SESSIONS[app] ||= Class.new(Integration::Session) {
-
-
- if app.respond_to?(:routes) && app.routes.is_a?(ActionDispatch::Routing::RouteSet)
- include app.routes.url_helpers
- include app.routes.mounted_helpers
- end
- }
- klass.new(app)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -227,22 +227,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/integration.rb, line 420
+ def default_url_options
+ integration_session.default_url_options
+ end
-
- Source:
-
-
-
-
-def default_url_options
- integration_session.default_url_options
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -262,22 +262,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/integration.rb, line 424
+ def default_url_options=(options)
+ integration_session.default_url_options = options
+ end
-
- Source:
-
-
-
-
-def default_url_options=(options)
- integration_session.default_url_options = options
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -297,22 +297,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/integration.rb, line 343
+ def integration_session
+ @integration_session ||= create_session(app)
+ end
-
- Source:
-
-
-
-
-def integration_session
- @integration_session ||= create_session(app)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -339,26 +339,26 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/integration.rb, line 396
+ def open_session
+ dup.tap do |session|
+ session.reset!
+ session.root_session = self.root_session || self
+ yield session if block_given?
+ end
+ end
-
- Source:
-
-
-
-
-def open_session
- dup.tap do |session|
- session.reset!
- session.root_session = self.root_session || self
- yield session if block_given?
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -378,22 +378,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/integration.rb, line 349
+ def reset!
+ @integration_session = create_session(app)
+ end
-
- Source:
-
-
-
-
-def reset!
- @integration_session = create_session(app)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/Integration/Session.html b/src/classes/ActionDispatch/Integration/Session.html
index 97d156df2a..4ef812cf8d 100644
--- a/src/classes/ActionDispatch/Integration/Session.html
+++ b/src/classes/ActionDispatch/Integration/Session.html
@@ -224,25 +224,25 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/integration.rb, line 131
+ def initialize(app)
+ super()
+ @app = app
+
+ reset!
+ end
-
- Source:
-
-
-
-
-def initialize(app)
- super()
- @app = app
-
- reset!
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -266,22 +266,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/integration.rb, line 112
+ def cookies
+ _mock_session.cookie_jar
+ end
-
- Source:
-
-
-
-
-def cookies
- _mock_session.cookie_jar
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -301,22 +301,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/integration.rb, line 99
+ def host
+ @host || DEFAULT_HOST
+ end
-
- Source:
-
-
-
-
-def host
- @host || DEFAULT_HOST
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -340,22 +340,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/integration.rb, line 179
+ def https!(flag = true)
+ @https = flag
+ end
-
- Source:
-
-
-
-
-def https!(flag = true)
- @https = flag
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -380,22 +380,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/integration.rb, line 188
+ def https?
+ @https
+ end
-
- Source:
-
-
-
-
-def https?
- @https
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -439,95 +439,95 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/integration.rb, line 226
+ def process(method, path, params: nil, headers: nil, env: nil, xhr: false, as: nil)
+ request_encoder = RequestEncoder.encoder(as)
+ headers ||= {}
+
+ if method == :get && as == :json && params
+ headers["X-Http-Method-Override"] = "GET"
+ method = :post
+ end
+
+ if path.include?("://")
+ path = build_expanded_path(path) do |location|
+ https! URI::HTTPS === location if location.scheme
+
+ if url_host = location.host
+ default = Rack::Request::DEFAULT_PORTS[location.scheme]
+ url_host += ":#{location.port}" if default != location.port
+ host! url_host
+ end
+ end
+ end
+
+ hostname, port = host.split(":")
+
+ request_env = {
+ :method => method,
+ :params => request_encoder.encode_params(params),
+
+ "SERVER_NAME" => hostname,
+ "SERVER_PORT" => port || (https? ? "443" : "80"),
+ "HTTPS" => https? ? "on" : "off",
+ "rack.url_scheme" => https? ? "https" : "http",
+
+ "REQUEST_URI" => path,
+ "HTTP_HOST" => host,
+ "REMOTE_ADDR" => remote_addr,
+ "HTTP_ACCEPT" => request_encoder.accept_header || accept
+ }
+
+ if request_encoder.content_type
+ request_env["CONTENT_TYPE"] = request_encoder.content_type
+ end
+
+ wrapped_headers = Http::Headers.from_hash({})
+ wrapped_headers.merge!(headers) if headers
+
+ if xhr
+ wrapped_headers["HTTP_X_REQUESTED_WITH"] = "XMLHttpRequest"
+ wrapped_headers["HTTP_ACCEPT"] ||= [Mime[:js], Mime[:html], Mime[:xml], "text/xml", "*/*"].join(", ")
+ end
+
+ # This modifies the passed request_env directly.
+ if wrapped_headers.present?
+ Http::Headers.from_hash(request_env).merge!(wrapped_headers)
+ end
+ if env.present?
+ Http::Headers.from_hash(request_env).merge!(env)
+ end
+
+ session = Rack::Test::Session.new(_mock_session)
+
+ # NOTE: rack-test v0.5 doesn't build a default uri correctly
+ # Make sure requested path is always a full URI.
+ session.request(build_full_uri(path, request_env), request_env)
+
+ @request_count += 1
+ @request = ActionDispatch::Request.new(session.last_request.env)
+ response = _mock_session.last_response
+ @response = ActionDispatch::TestResponse.from_response(response)
+ @response.request = @request
+ @html_document = nil
+ @url_options = nil
+
+ @controller = @request.controller_instance
+
+ response.status
+ end
-
- Source:
-
-
-
-
-def process(method, path, params: nil, headers: nil, env: nil, xhr: false, as: nil)
- request_encoder = RequestEncoder.encoder(as)
- headers ||= {}
-
- if method == :get && as == :json && params
- headers["X-Http-Method-Override"] = "GET"
- method = :post
- end
-
- if path.include?("://")
- path = build_expanded_path(path) do |location|
- https! URI::HTTPS === location if location.scheme
-
- if url_host = location.host
- default = Rack::Request::DEFAULT_PORTS[location.scheme]
- url_host += ":#{location.port}" if default != location.port
- host! url_host
- end
- end
- end
-
- hostname, port = host.split(":")
-
- request_env = {
- :method => method,
- :params => request_encoder.encode_params(params),
-
- "SERVER_NAME" => hostname,
- "SERVER_PORT" => port || (https? ? "443" : "80"),
- "HTTPS" => https? ? "on" : "off",
- "rack.url_scheme" => https? ? "https" : "http",
-
- "REQUEST_URI" => path,
- "HTTP_HOST" => host,
- "REMOTE_ADDR" => remote_addr,
- "HTTP_ACCEPT" => request_encoder.accept_header || accept
- }
-
- if request_encoder.content_type
- request_env["CONTENT_TYPE"] = request_encoder.content_type
- end
-
- wrapped_headers = Http::Headers.from_hash({})
- wrapped_headers.merge!(headers) if headers
-
- if xhr
- wrapped_headers["HTTP_X_REQUESTED_WITH"] = "XMLHttpRequest"
- wrapped_headers["HTTP_ACCEPT"] ||= [Mime[:js], Mime[:html], Mime[:xml], "text/xml", "*/*"].join(", ")
- end
-
-
- if wrapped_headers.present?
- Http::Headers.from_hash(request_env).merge!(wrapped_headers)
- end
- if env.present?
- Http::Headers.from_hash(request_env).merge!(env)
- end
-
- session = Rack::Test::Session.new(_mock_session)
-
-
-
- session.request(build_full_uri(path, request_env), request_env)
-
- @request_count += 1
- @request = ActionDispatch::Request.new(session.last_request.env)
- response = _mock_session.last_response
- @response = ActionDispatch::TestResponse.from_response(response)
- @response.request = @request
- @html_document = nil
- @url_options = nil
-
- @controller = @request.controller_instance
-
- response.status
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -550,38 +550,38 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/integration.rb, line 155
+ def reset!
+ @https = false
+ @controller = @request = @response = nil
+ @_mock_session = nil
+ @request_count = 0
+ @url_options = nil
+
+ self.host = DEFAULT_HOST
+ self.remote_addr = "127.0.0.1"
+ self.accept = "text/xml,application/xml,application/xhtml+xml," \
+ "text/html;q=0.9,text/plain;q=0.8,image/png," \
+ "*/*;q=0.5"
+
+ unless defined? @named_routes_configured
+ # the helpers are made protected by default--we make them public for
+ # easier access during testing and troubleshooting.
+ @named_routes_configured = true
+ end
+ end
-
- Source:
-
-
-
-
-def reset!
- @https = false
- @controller = @request = @response = nil
- @_mock_session = nil
- @request_count = 0
- @url_options = nil
-
- self.host = DEFAULT_HOST
- self.remote_addr = "127.0.0.1"
- self.accept = "text/xml,application/xml,application/xhtml+xml," \
- "text/html;q=0.9,text/plain;q=0.8,image/png," \
- "*/*;q=0.5"
-
- unless defined? @named_routes_configured
-
-
- @named_routes_configured = true
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -601,30 +601,30 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/integration.rb, line 138
+ def url_options
+ @url_options ||= default_url_options.dup.tap do |url_options|
+ url_options.reverse_merge!(controller.url_options) if controller.respond_to?(:url_options)
+
+ if @app.respond_to?(:routes)
+ url_options.reverse_merge!(@app.routes.default_url_options)
+ end
+
+ url_options.reverse_merge!(host: host, protocol: https? ? "https" : "http")
+ end
+ end
-
- Source:
-
-
-
-
-def url_options
- @url_options ||= default_url_options.dup.tap do |url_options|
- url_options.reverse_merge!(controller.url_options) if controller.respond_to?(:url_options)
-
- if @app.respond_to?(:routes)
- url_options.reverse_merge!(@app.routes.default_url_options)
- end
-
- url_options.reverse_merge!(host: host, protocol: https? ? "https" : "http")
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/IntegrationTest/Behavior.html b/src/classes/ActionDispatch/IntegrationTest/Behavior.html
index b5584e47e3..849dd3f313 100644
--- a/src/classes/ActionDispatch/IntegrationTest/Behavior.html
+++ b/src/classes/ActionDispatch/IntegrationTest/Behavior.html
@@ -114,22 +114,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/integration.rb, line 682
+ def app
+ super || self.class.app
+ end
-
- Source:
-
-
-
-
-def app
- super || self.class.app
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -149,22 +149,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/integration.rb, line 686
+ def document_root_element
+ html_document.root
+ end
-
- Source:
-
-
-
-
-def document_root_element
- html_document.root
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/IntegrationTest/Behavior/ClassMethods.html b/src/classes/ActionDispatch/IntegrationTest/Behavior/ClassMethods.html
index d82adfb5d4..e64cf02c9e 100644
--- a/src/classes/ActionDispatch/IntegrationTest/Behavior/ClassMethods.html
+++ b/src/classes/ActionDispatch/IntegrationTest/Behavior/ClassMethods.html
@@ -83,26 +83,26 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/integration.rb, line 665
+ def app
+ if defined?(@@app) && @@app
+ @@app
+ else
+ ActionDispatch.test_app
+ end
+ end
-
- Source:
-
-
-
-
-def app
- if defined?(@@app) && @@app
- @@app
- else
- ActionDispatch.test_app
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -122,22 +122,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/integration.rb, line 673
+ def app=(app)
+ @@app = app
+ end
-
- Source:
-
-
-
-
-def app=(app)
- @@app = app
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -157,22 +157,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/integration.rb, line 677
+ def register_encoder(*args, **options)
+ RequestEncoder.register_encoder(*args, **options)
+ end
-
- Source:
-
-
-
-
-def register_encoder(*args, **options)
- RequestEncoder.register_encoder(*args, **options)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/IntegrationTest/UrlOptions.html b/src/classes/ActionDispatch/IntegrationTest/UrlOptions.html
index 52d225a198..bd4ccf38d1 100644
--- a/src/classes/ActionDispatch/IntegrationTest/UrlOptions.html
+++ b/src/classes/ActionDispatch/IntegrationTest/UrlOptions.html
@@ -75,22 +75,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/testing/integration.rb, line 646
+ def url_options
+ integration_session.url_options
+ end
-
- Source:
-
-
-
-
-def url_options
- integration_session.url_options
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/Journey/Formatter/RegexCaseComparator.html b/src/classes/ActionDispatch/Journey/Formatter/RegexCaseComparator.html
deleted file mode 100644
index c698c2fda5..0000000000
--- a/src/classes/ActionDispatch/Journey/Formatter/RegexCaseComparator.html
+++ /dev/null
@@ -1,54 +0,0 @@
----
-title: ActionDispatch::Journey::Formatter::RegexCaseComparator
-layout: default
----
-
-
-
-
Ruby on Rails 6.0.3.7
-
-
Module
-
- ActionDispatch::Journey::Formatter::RegexCaseComparator
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/classes/ActionDispatch/LogSubscriber.html b/src/classes/ActionDispatch/LogSubscriber.html
index ff04361d95..5ee9adf574 100644
--- a/src/classes/ActionDispatch/LogSubscriber.html
+++ b/src/classes/ActionDispatch/LogSubscriber.html
@@ -81,33 +81,33 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/log_subscriber.rb, line 5
+ def redirect(event)
+ payload = event.payload
+
+ info { "Redirected to #{payload[:location]}" }
+
+ info do
+ status = payload[:status]
+
+ message = +"Completed #{status} #{Rack::Utils::HTTP_STATUS_CODES[status]} in #{event.duration.round}ms"
+ message << "\n\n" if defined?(Rails.env) && Rails.env.development?
+
+ message
+ end
+ end
-
- Source:
-
-
-
-
-def redirect(event)
- payload = event.payload
-
- info { "Redirected to #{payload[:location]}" }
-
- info do
- status = payload[:status]
-
- message = +"Completed #{status} #{Rack::Utils::HTTP_STATUS_CODES[status]} in #{event.duration.round}ms"
- message << "\n\n" if defined?(Rails.env) && Rails.env.development?
-
- message
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/MiddlewareStack.html b/src/classes/ActionDispatch/MiddlewareStack.html
index 1ff9e0e284..92fc87f14b 100644
--- a/src/classes/ActionDispatch/MiddlewareStack.html
+++ b/src/classes/ActionDispatch/MiddlewareStack.html
@@ -199,23 +199,23 @@
-
-
-
-
- Source:
-
-
-
-
-def initialize(*args)
- @middlewares = []
- yield(self) if block_given?
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/stack.rb, line 75
+ def initialize(*args)
+ @middlewares = []
+ yield(self) if block_given?
+ end
+
+ See on GitHub
+
+
+
+
@@ -239,22 +239,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/stack.rb, line 92
+ def [](i)
+ middlewares[i]
+ end
-
- Source:
-
-
-
-
-def [](i)
- middlewares[i]
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -274,29 +274,29 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/stack.rb, line 165
+ def build(app = nil, &block)
+ instrumenting = ActiveSupport::Notifications.notifier.listening?(InstrumentationProxy::EVENT_NAME)
+ middlewares.freeze.reverse.inject(app || block) do |a, e|
+ if instrumenting
+ e.build_instrumented(a)
+ else
+ e.build(a)
+ end
+ end
+ end
-
- Source:
-
-
-
-
-def build(app = nil, &block)
- instrumenting = ActiveSupport::Notifications.notifier.listening?(InstrumentationProxy::EVENT_NAME)
- middlewares.freeze.reverse.inject(app || block) do |a, e|
- if instrumenting
- e.build_instrumented(a)
- else
- e.build(a)
- end
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -318,22 +318,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/stack.rb, line 130
+ def delete(target)
+ middlewares.reject! { |m| m.name == target.name }
+ end
-
- Source:
-
-
-
-
-def delete(target)
- middlewares.reject! { |m| m.name == target.name }
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -355,22 +355,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/stack.rb, line 138
+ def delete!(target)
+ delete(target) || (raise "No such middleware to remove: #{target.inspect}")
+ end
-
- Source:
-
-
-
-
-def delete!(target)
- delete(target) || (raise "No such middleware to remove: #{target.inspect}")
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -390,22 +390,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/stack.rb, line 80
+ def each(&block)
+ @middlewares.each(&block)
+ end
-
- Source:
-
-
-
-
-def each(&block)
- @middlewares.each(&block)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -425,22 +425,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/stack.rb, line 101
+ def initialize_copy(other)
+ self.middlewares = other.middlewares.dup
+ end
-
- Source:
-
-
-
-
-def initialize_copy(other)
- self.middlewares = other.middlewares.dup
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -464,23 +464,23 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/stack.rb, line 105
+ def insert(index, klass, *args, &block)
+ index = assert_index(index, :before)
+ middlewares.insert(index, build_middleware(klass, args, block))
+ end
-
- Source:
-
-
-
-
-def insert(index, klass, *args, &block)
- index = assert_index(index, :before)
- middlewares.insert(index, build_middleware(klass, args, block))
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -500,23 +500,23 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/stack.rb, line 113
+ def insert_after(index, *args, &block)
+ index = assert_index(index, :after)
+ insert(index + 1, *args, &block)
+ end
-
- Source:
-
-
-
-
-def insert_after(index, *args, &block)
- index = assert_index(index, :after)
- insert(index + 1, *args, &block)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -540,7 +540,8 @@
-
+
+
@@ -560,22 +561,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/stack.rb, line 88
+ def last
+ middlewares.last
+ end
-
- Source:
-
-
-
-
-def last
- middlewares.last
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -599,26 +600,26 @@
-
-
-
-
- Source:
-
-
-
-
-def move(target, source)
- source_index = assert_index(source, :before)
- source_middleware = middlewares.delete_at(source_index)
+
+
+
+ Source code
+
- target_index = assert_index(target, :before)
- middlewares.insert(target_index, source_middleware)
-end
-
-
-
-
+ # File actionpack/lib/action_dispatch/middleware/stack.rb, line 142
+ def move(target, source)
+ source_index = assert_index(source, :before)
+ source_middleware = middlewares.delete_at(source_index)
+
+ target_index = assert_index(target, :before)
+ middlewares.insert(target_index, source_middleware)
+ end
+
+ See on GitHub
+
+
+
+
@@ -638,26 +639,26 @@
-
-
-
-
- Source:
-
-
-
-
-def move_after(target, source)
- source_index = assert_index(source, :after)
- source_middleware = middlewares.delete_at(source_index)
+
+
+
+ Source code
+
- target_index = assert_index(target, :after)
- middlewares.insert(target_index + 1, source_middleware)
-end
-
-
-
-
+ # File actionpack/lib/action_dispatch/middleware/stack.rb, line 152
+ def move_after(target, source)
+ source_index = assert_index(source, :after)
+ source_middleware = middlewares.delete_at(source_index)
+
+ target_index = assert_index(target, :after)
+ middlewares.insert(target_index + 1, source_middleware)
+ end
+
+ See on GitHub
+
+
+
+
@@ -681,7 +682,8 @@
-
+
+
@@ -701,22 +703,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/stack.rb, line 84
+ def size
+ middlewares.size
+ end
-
- Source:
-
-
-
-
-def size
- middlewares.size
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -736,24 +738,24 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/stack.rb, line 119
+ def swap(target, *args, &block)
+ index = assert_index(target, :before)
+ insert(index, *args, &block)
+ middlewares.delete_at(index + 1)
+ end
-
- Source:
-
-
-
-
-def swap(target, *args, &block)
- index = assert_index(target, :before)
- insert(index, *args, &block)
- middlewares.delete_at(index + 1)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -773,22 +775,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/stack.rb, line 96
+ def unshift(klass, *args, &block)
+ middlewares.unshift(build_middleware(klass, args, block))
+ end
-
- Source:
-
-
-
-
-def unshift(klass, *args, &block)
- middlewares.unshift(build_middleware(klass, args, block))
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -808,22 +810,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/stack.rb, line 160
+ def use(klass, *args, &block)
+ middlewares.push(build_middleware(klass, args, block))
+ end
-
- Source:
-
-
-
-
-def use(klass, *args, &block)
- middlewares.push(build_middleware(klass, args, block))
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/MiddlewareStack/InstrumentationProxy.html b/src/classes/ActionDispatch/MiddlewareStack/InstrumentationProxy.html
index ee15cb5ac8..cf3510698c 100644
--- a/src/classes/ActionDispatch/MiddlewareStack/InstrumentationProxy.html
+++ b/src/classes/ActionDispatch/MiddlewareStack/InstrumentationProxy.html
@@ -108,26 +108,26 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/stack.rb, line 56
+ def initialize(middleware, class_name)
+ @middleware = middleware
+
+ @payload = {
+ middleware: class_name,
+ }
+ end
-
- Source:
-
-
-
-
-def initialize(middleware, class_name)
- @middleware = middleware
-
- @payload = {
- middleware: class_name,
- }
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -151,24 +151,24 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/stack.rb, line 64
+ def call(env)
+ ActiveSupport::Notifications.instrument(EVENT_NAME, @payload) do
+ @middleware.call(env)
+ end
+ end
-
- Source:
-
-
-
-
-def call(env)
- ActiveSupport::Notifications.instrument(EVENT_NAME, @payload) do
- @middleware.call(env)
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/MiddlewareStack/Middleware.html b/src/classes/ActionDispatch/MiddlewareStack/Middleware.html
index 87fa989945..e62772d5dd 100644
--- a/src/classes/ActionDispatch/MiddlewareStack/Middleware.html
+++ b/src/classes/ActionDispatch/MiddlewareStack/Middleware.html
@@ -130,24 +130,24 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/stack.rb, line 16
+ def initialize(klass, args, block)
+ @klass = klass
+ @args = args
+ @block = block
+ end
-
- Source:
-
-
-
-
-def initialize(klass, args, block)
- @klass = klass
- @args = args
- @block = block
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -171,27 +171,27 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/stack.rb, line 24
+ def ==(middleware)
+ case middleware
+ when Middleware
+ klass == middleware.klass
+ when Module
+ klass == middleware
+ end
+ end
-
- Source:
-
-
-
-
-def ==(middleware)
- case middleware
- when Middleware
- klass == middleware.klass
- when Module
- klass == middleware
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -211,22 +211,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/stack.rb, line 41
+ def build(app)
+ klass.new(app, *args, &block)
+ end
-
- Source:
-
-
-
-
-def build(app)
- klass.new(app, *args, &block)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -246,22 +246,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/stack.rb, line 45
+ def build_instrumented(app)
+ InstrumentationProxy.new(build(app), inspect)
+ end
-
- Source:
-
-
-
-
-def build_instrumented(app)
- InstrumentationProxy.new(build(app), inspect)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -281,26 +281,26 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/stack.rb, line 33
+ def inspect
+ if klass.is_a?(Module)
+ klass.to_s
+ else
+ klass.class.to_s
+ end
+ end
-
- Source:
-
-
-
-
-def inspect
- if klass.is_a?(Module)
- klass.to_s
- else
- klass.class.to_s
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -320,20 +320,20 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/stack.rb, line 22
+ def name; klass.name; end
-
- Source:
-
-
-
-
-def name; klass.name; end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/PermissionsPolicy.html b/src/classes/ActionDispatch/PermissionsPolicy.html
index 6e0abaabfd..794bf0edc0 100644
--- a/src/classes/ActionDispatch/PermissionsPolicy.html
+++ b/src/classes/ActionDispatch/PermissionsPolicy.html
@@ -146,23 +146,23 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/permissions_policy.rb, line 116
+ def initialize
+ @directives = {}
+ yield self if block_given?
+ end
-
- Source:
-
-
-
-
-def initialize
- @directives = {}
- yield self if block_given?
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -186,22 +186,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/permissions_policy.rb, line 154
+ def build(context = nil)
+ build_directives(context).compact.join("; ")
+ end
-
- Source:
-
-
-
-
-def build(context = nil)
- build_directives(context).compact.join("; ")
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -221,22 +221,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/permissions_policy.rb, line 121
+ def initialize_copy(other)
+ @directives = other.directives.deep_dup
+ end
-
- Source:
-
-
-
-
-def initialize_copy(other)
- @directives = other.directives.deep_dup
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/PermissionsPolicy/Middleware.html b/src/classes/ActionDispatch/PermissionsPolicy/Middleware.html
index a1004e7572..78d9555bd3 100644
--- a/src/classes/ActionDispatch/PermissionsPolicy/Middleware.html
+++ b/src/classes/ActionDispatch/PermissionsPolicy/Middleware.html
@@ -84,22 +84,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/permissions_policy.rb, line 31
+ def initialize(app)
+ @app = app
+ end
-
- Source:
-
-
-
-
-def initialize(app)
- @app = app
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -123,37 +123,37 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/permissions_policy.rb, line 35
+ def call(env)
+ _, headers, _ = response = @app.call(env)
+
+ return response unless html_response?(headers)
+ return response if policy_present?(headers)
+
+ request = ActionDispatch::Request.new(env)
+
+ if policy = request.permissions_policy
+ headers[ActionDispatch::Constants::FEATURE_POLICY] = policy.build(request.controller_instance)
+ end
+
+ if policy_empty?(policy)
+ headers.delete(ActionDispatch::Constants::FEATURE_POLICY)
+ end
+
+ response
+ end
-
- Source:
-
-
-
-
-def call(env)
- _, headers, _ = response = @app.call(env)
-
- return response unless html_response?(headers)
- return response if policy_present?(headers)
-
- request = ActionDispatch::Request.new(env)
-
- if policy = request.permissions_policy
- headers[ActionDispatch::Constants::FEATURE_POLICY] = policy.build(request.controller_instance)
- end
-
- if policy_empty?(policy)
- headers.delete(ActionDispatch::Constants::FEATURE_POLICY)
- end
-
- response
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/PermissionsPolicy/Request.html b/src/classes/ActionDispatch/PermissionsPolicy/Request.html
index e241e17f3c..ec16e781ff 100644
--- a/src/classes/ActionDispatch/PermissionsPolicy/Request.html
+++ b/src/classes/ActionDispatch/PermissionsPolicy/Request.html
@@ -97,22 +97,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/permissions_policy.rb, line 73
+ def permissions_policy
+ get_header(POLICY)
+ end
-
- Source:
-
-
-
-
-def permissions_policy
- get_header(POLICY)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -132,22 +132,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/permissions_policy.rb, line 77
+ def permissions_policy=(policy)
+ set_header(POLICY, policy)
+ end
-
- Source:
-
-
-
-
-def permissions_policy=(policy)
- set_header(POLICY, policy)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/PublicExceptions.html b/src/classes/ActionDispatch/PublicExceptions.html
index 717c30393f..31d0f8bf24 100644
--- a/src/classes/ActionDispatch/PublicExceptions.html
+++ b/src/classes/ActionDispatch/PublicExceptions.html
@@ -108,22 +108,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/public_exceptions.rb, line 19
+ def initialize(public_path)
+ @public_path = public_path
+ end
-
- Source:
-
-
-
-
-def initialize(public_path)
- @public_path = public_path
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -147,31 +147,31 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/public_exceptions.rb, line 23
+ def call(env)
+ request = ActionDispatch::Request.new(env)
+ status = request.path_info[1..-1].to_i
+ begin
+ content_type = request.formats.first
+ rescue ActionDispatch::Http::MimeNegotiation::InvalidType
+ content_type = Mime[:text]
+ end
+ body = { status: status, error: Rack::Utils::HTTP_STATUS_CODES.fetch(status, Rack::Utils::HTTP_STATUS_CODES[500]) }
+
+ render(status, content_type, body)
+ end
-
- Source:
-
-
-
-
-def call(env)
- request = ActionDispatch::Request.new(env)
- status = request.path_info[1..-1].to_i
- begin
- content_type = request.formats.first
- rescue ActionDispatch::Http::MimeNegotiation::InvalidType
- content_type = Mime[:text]
- end
- body = { status: status, error: Rack::Utils::HTTP_STATUS_CODES.fetch(status, Rack::Utils::HTTP_STATUS_CODES[500]) }
-
- render(status, content_type, body)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/RailsEntityStore.html b/src/classes/ActionDispatch/RailsEntityStore.html
deleted file mode 100644
index fc41058323..0000000000
--- a/src/classes/ActionDispatch/RailsEntityStore.html
+++ /dev/null
@@ -1,322 +0,0 @@
----
-title: ActionDispatch::RailsEntityStore
-layout: default
----
-
-
-
-
Ruby on Rails 7.0.8
-
-
Class
-
- ActionDispatch::RailsEntityStore
-
- <
-
- Rack::Cache::EntityStore
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Namespace
-
-
-
Module
-
-
-
-
-
-
-
-
Methods
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Class Public methods
-
-
-
-
- new(store = Rails.cache)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Source:
-
-
-
-
-def initialize(store = Rails.cache)
- @store = store
-end
-
-
-
-
-
-
-
-
- resolve(uri)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Source:
-
-
-
-
-def self.resolve(uri)
- new
-end
-
-
-
-
-
-
-
-
Instance Public methods
-
-
-
-
- exist?(key)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Source:
-
-
-
-
-def exist?(key)
- @store.exist?(key)
-end
-
-
-
-
-
-
-
-
- open(key)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Source:
-
-
-
-
-def open(key)
- @store.read(key)
-end
-
-
-
-
-
-
-
-
- read(key)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Source:
-
-
-
-
-def read(key)
- body = open(key)
- body.join if body
-end
-
-
-
-
-
-
-
-
- write(body)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Source:
-
-
-
-
-def write(body)
- buf = []
- key, size = slurp(body) { |part| buf << part }
- @store.write(key, buf)
- [key, size]
-end
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/classes/ActionDispatch/RailsEntityStore/Rack.html b/src/classes/ActionDispatch/RailsEntityStore/Rack.html
deleted file mode 100644
index 87a76bcc6d..0000000000
--- a/src/classes/ActionDispatch/RailsEntityStore/Rack.html
+++ /dev/null
@@ -1,67 +0,0 @@
----
-title: ActionDispatch::RailsEntityStore::Rack
-layout: default
----
-
-
-
-
Ruby on Rails 7.0.8
-
-
Module
-
- ActionDispatch::RailsEntityStore::Rack
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Namespace
-
-
-
Module
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/classes/ActionDispatch/RailsEntityStore/Rack/Cache.html b/src/classes/ActionDispatch/RailsEntityStore/Rack/Cache.html
deleted file mode 100644
index 64defef17e..0000000000
--- a/src/classes/ActionDispatch/RailsEntityStore/Rack/Cache.html
+++ /dev/null
@@ -1,67 +0,0 @@
----
-title: ActionDispatch::RailsEntityStore::Rack::Cache
-layout: default
----
-
-
-
-
Ruby on Rails 7.0.8
-
-
Module
-
- ActionDispatch::RailsEntityStore::Rack::Cache
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Namespace
-
-
-
Module
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/classes/ActionDispatch/RailsEntityStore/Rack/Cache/EntityStore.html b/src/classes/ActionDispatch/RailsEntityStore/Rack/Cache/EntityStore.html
deleted file mode 100644
index 69f91d9277..0000000000
--- a/src/classes/ActionDispatch/RailsEntityStore/Rack/Cache/EntityStore.html
+++ /dev/null
@@ -1,72 +0,0 @@
----
-title: ActionDispatch::RailsEntityStore::Rack::Cache::EntityStore
-layout: default
----
-
-
-
-
Ruby on Rails 7.0.8
-
-
Module
-
- ActionDispatch::RailsEntityStore::Rack::Cache::EntityStore
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Constants
-
-
-
- RAILS |
- = |
- self |
-
-
-
- |
- |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/classes/ActionDispatch/RailsMetaStore.html b/src/classes/ActionDispatch/RailsMetaStore.html
deleted file mode 100644
index febcec84ec..0000000000
--- a/src/classes/ActionDispatch/RailsMetaStore.html
+++ /dev/null
@@ -1,244 +0,0 @@
----
-title: ActionDispatch::RailsMetaStore
-layout: default
----
-
-
-
-
Ruby on Rails 7.0.8
-
-
Class
-
- ActionDispatch::RailsMetaStore
-
- <
-
- Rack::Cache::MetaStore
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Namespace
-
-
-
Module
-
-
-
-
-
-
-
-
Methods
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Class Public methods
-
-
-
-
- new(store = Rails.cache)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Source:
-
-
-
-
-def initialize(store = Rails.cache)
- @store = store
-end
-
-
-
-
-
-
-
-
- resolve(uri)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Source:
-
-
-
-
-def self.resolve(uri)
- new
-end
-
-
-
-
-
-
-
-
Instance Public methods
-
-
-
-
- read(key)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Source:
-
-
-
-
-def read(key)
- if data = @store.read(key)
- Marshal.load(data)
- else
- []
- end
-end
-
-
-
-
-
-
-
-
- write(key, value)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Source:
-
-
-
-
-def write(key, value)
- @store.write(key, Marshal.dump(value))
-end
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/classes/ActionDispatch/RailsMetaStore/Rack.html b/src/classes/ActionDispatch/RailsMetaStore/Rack.html
deleted file mode 100644
index 11236e06d1..0000000000
--- a/src/classes/ActionDispatch/RailsMetaStore/Rack.html
+++ /dev/null
@@ -1,67 +0,0 @@
----
-title: ActionDispatch::RailsMetaStore::Rack
-layout: default
----
-
-
-
-
Ruby on Rails 7.0.8
-
-
Module
-
- ActionDispatch::RailsMetaStore::Rack
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Namespace
-
-
-
Module
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/classes/ActionDispatch/RailsMetaStore/Rack/Cache.html b/src/classes/ActionDispatch/RailsMetaStore/Rack/Cache.html
deleted file mode 100644
index efe5ee07b5..0000000000
--- a/src/classes/ActionDispatch/RailsMetaStore/Rack/Cache.html
+++ /dev/null
@@ -1,67 +0,0 @@
----
-title: ActionDispatch::RailsMetaStore::Rack::Cache
-layout: default
----
-
-
-
-
Ruby on Rails 7.0.8
-
-
Module
-
- ActionDispatch::RailsMetaStore::Rack::Cache
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Namespace
-
-
-
Module
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/classes/ActionDispatch/RailsMetaStore/Rack/Cache/MetaStore.html b/src/classes/ActionDispatch/RailsMetaStore/Rack/Cache/MetaStore.html
deleted file mode 100644
index 472df70d74..0000000000
--- a/src/classes/ActionDispatch/RailsMetaStore/Rack/Cache/MetaStore.html
+++ /dev/null
@@ -1,72 +0,0 @@
----
-title: ActionDispatch::RailsMetaStore::Rack::Cache::MetaStore
-layout: default
----
-
-
-
-
Ruby on Rails 7.0.8
-
-
Module
-
- ActionDispatch::RailsMetaStore::Rack::Cache::MetaStore
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Constants
-
-
-
- RAILS |
- = |
- self |
-
-
-
- |
- |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/classes/ActionDispatch/RemoteIp.html b/src/classes/ActionDispatch/RemoteIp.html
index 576636ef79..e3da58b796 100644
--- a/src/classes/ActionDispatch/RemoteIp.html
+++ b/src/classes/ActionDispatch/RemoteIp.html
@@ -162,42 +162,42 @@
-
-
-
-
- Source:
-
-
-
-
- def initialize(app, ip_spoofing_check = true, custom_proxies = nil)
- @app = app
- @check_ip = ip_spoofing_check
- @proxies = if custom_proxies.blank?
- TRUSTED_PROXIES
- elsif custom_proxies.respond_to?(:any?)
- custom_proxies
- else
- raise(ArgumentError, <<~EOM)
- Setting config.action_dispatch.trusted_proxies to a single value isn't
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/remote_ip.rb, line 61
+ def initialize(app, ip_spoofing_check = true, custom_proxies = nil)
+ @app = app
+ @check_ip = ip_spoofing_check
+ @proxies = if custom_proxies.blank?
+ TRUSTED_PROXIES
+ elsif custom_proxies.respond_to?(:any?)
+ custom_proxies
+ else
+ raise(ArgumentError, <<~EOM)
+ Setting config.action_dispatch.trusted_proxies to a single value isn't
supported. Please set this to an enumerable instead. For
example, instead of:
- config.action_dispatch.trusted_proxies = IPAddr.new("10.0.0.0/8")
+ config.action_dispatch.trusted_proxies = IPAddr.new("10.0.0.0/8")
Wrap the value in an Array:
- config.action_dispatch.trusted_proxies = [IPAddr.new("10.0.0.0/8")]
+ config.action_dispatch.trusted_proxies = [IPAddr.new("10.0.0.0/8")]
Note that passing an enumerable will *replace* the default set of trusted proxies.
-
EOM
- end
- end
-
-
-
-
+ EOM
+ end
+ end
+
+ See on GitHub
+
+
+
+
@@ -221,24 +221,24 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/remote_ip.rb, line 89
+ def call(env)
+ req = ActionDispatch::Request.new env
+ req.remote_ip = GetIp.new(req, check_ip, proxies)
+ @app.call(req.env)
+ end
-
- Source:
-
-
-
-
-def call(env)
- req = ActionDispatch::Request.new env
- req.remote_ip = GetIp.new(req, check_ip, proxies)
- @app.call(req.env)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/RemoteIp/GetIp.html b/src/classes/ActionDispatch/RemoteIp/GetIp.html
index 95019c3023..e1ab8ba496 100644
--- a/src/classes/ActionDispatch/RemoteIp/GetIp.html
+++ b/src/classes/ActionDispatch/RemoteIp/GetIp.html
@@ -102,24 +102,24 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/remote_ip.rb, line 99
+ def initialize(req, check_ip, proxies)
+ @req = req
+ @check_ip = check_ip
+ @proxies = proxies
+ end
-
- Source:
-
-
-
-
-def initialize(req, check_ip, proxies)
- @req = req
- @check_ip = check_ip
- @proxies = proxies
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -149,60 +149,60 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/remote_ip.rb, line 123
+ def calculate_ip
+ # Set by the Rack web server, this is a single value.
+ remote_addr = ips_from(@req.remote_addr).last
+
+ # Could be a CSV list and/or repeated headers that were concatenated.
+ client_ips = ips_from(@req.client_ip).reverse!
+ forwarded_ips = ips_from(@req.x_forwarded_for).reverse!
+
+ # +Client-Ip+ and +X-Forwarded-For+ should not, generally, both be set.
+ # If they are both set, it means that either:
+ #
+ # 1) This request passed through two proxies with incompatible IP header
+ # conventions.
+ # 2) The client passed one of +Client-Ip+ or +X-Forwarded-For+
+ # (whichever the proxy servers weren't using) themselves.
+ #
+ # Either way, there is no way for us to determine which header is the
+ # right one after the fact. Since we have no idea, if we are concerned
+ # about IP spoofing we need to give up and explode. (If you're not
+ # concerned about IP spoofing you can turn the +ip_spoofing_check+
+ # option off.)
+ should_check_ip = @check_ip && client_ips.last && forwarded_ips.last
+ if should_check_ip && !forwarded_ips.include?(client_ips.last)
+ # We don't know which came from the proxy, and which from the user
+ raise IpSpoofAttackError, "IP spoofing attack?! " \
+ "HTTP_CLIENT_IP=#{@req.client_ip.inspect} " \
+ "HTTP_X_FORWARDED_FOR=#{@req.x_forwarded_for.inspect}"
+ end
+
+ # We assume these things about the IP headers:
+ #
+ # - X-Forwarded-For will be a list of IPs, one per proxy, or blank
+ # - Client-Ip is propagated from the outermost proxy, or is blank
+ # - REMOTE_ADDR will be the IP that made the request to Rack
+ ips = forwarded_ips + client_ips
+ ips.compact!
+
+ # If every single IP option is in the trusted list, return the IP
+ # that's furthest away
+ filter_proxies(ips + [remote_addr]).first || ips.last || remote_addr
+ end
-
- Source:
-
-
-
-
-def calculate_ip
-
- remote_addr = ips_from(@req.remote_addr).last
-
-
- client_ips = ips_from(@req.client_ip).reverse!
- forwarded_ips = ips_from(@req.x_forwarded_for).reverse!
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- should_check_ip = @check_ip && client_ips.last && forwarded_ips.last
- if should_check_ip && !forwarded_ips.include?(client_ips.last)
-
- raise IpSpoofAttackError, "IP spoofing attack?! " \
- "HTTP_CLIENT_IP=#{@req.client_ip.inspect} " \
- "HTTP_X_FORWARDED_FOR=#{@req.x_forwarded_for.inspect}"
- end
-
-
-
-
-
-
- ips = forwarded_ips + client_ips
- ips.compact!
-
-
-
- filter_proxies(ips + [remote_addr]).first || ips.last || remote_addr
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -222,22 +222,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/remote_ip.rb, line 167
+ def to_s
+ @ip ||= calculate_ip
+ end
-
- Source:
-
-
-
-
-def to_s
- @ip ||= calculate_ip
-end
-
-
-
-
+ See on GitHub
+
+
+
+
Instance Private methods
@@ -260,24 +260,24 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/remote_ip.rb, line 187
+ def filter_proxies(ips) # :doc:
+ ips.reject do |ip|
+ @proxies.any? { |proxy| proxy === ip }
+ end
+ end
-
- Source:
-
-
-
-
-def filter_proxies(ips)
- ips.reject do |ip|
- @proxies.any? { |proxy| proxy === ip }
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -297,33 +297,33 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/remote_ip.rb, line 172
+ def ips_from(header) # :doc:
+ return [] unless header
+ # Split the comma-separated list into an array of strings.
+ ips = header.strip.split(/[,\s]+/)
+ ips.select! do |ip|
+ # Only return IPs that are valid according to the IPAddr#new method.
+ range = IPAddr.new(ip).to_range
+ # We want to make sure nobody is sneaking a netmask in.
+ range.begin == range.end
+ rescue ArgumentError
+ nil
+ end
+ ips
+ end
-
- Source:
-
-
-
-
-def ips_from(header)
- return [] unless header
-
- ips = header.strip.split(/[,\s]+/)
- ips.select! do |ip|
-
- range = IPAddr.new(ip).to_range
-
- range.begin == range.end
- rescue ArgumentError
- nil
- end
- ips
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/Request.html b/src/classes/ActionDispatch/Request.html
index 008928dc5e..927fb993c7 100644
--- a/src/classes/ActionDispatch/Request.html
+++ b/src/classes/ActionDispatch/Request.html
@@ -493,22 +493,22 @@
-
-
-
-
- Source:
-
-
-
-
-def self.empty
- new({})
-end
-
-
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 56
+ def self.empty
+ new({})
+ end
+
+ See on GitHub
+
+
+
+
@@ -528,28 +528,28 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 60
+ def initialize(env)
+ super
+ @method = nil
+ @request_method = nil
+ @remote_ip = nil
+ @original_fullpath = nil
+ @fullpath = nil
+ @ip = nil
+ end
-
- Source:
-
-
-
-
-def initialize(env)
- super
- @method = nil
- @request_method = nil
- @remote_ip = nil
- @original_fullpath = nil
- @fullpath = nil
- @ip = nil
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -577,32 +577,32 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 388
+ def GET
+ fetch_header("action_dispatch.request.query_parameters") do |k|
+ rack_query_params = super || {}
+ controller = path_parameters[:controller]
+ action = path_parameters[:action]
+ rack_query_params = Request::Utils.set_binary_encoding(self, rack_query_params, controller, action)
+ # Check for non UTF-8 parameter values, which would cause errors later
+ Request::Utils.check_param_encoding(rack_query_params)
+ set_header k, Request::Utils.normalize_encode_params(rack_query_params)
+ end
+ rescue Rack::Utils::ParameterTypeError, Rack::Utils::InvalidParameterError, Rack::QueryParser::ParamsTooDeepError => e
+ raise ActionController::BadRequest.new("Invalid query parameters: #{e.message}")
+ end
-
- Source:
-
-
-
-
-def GET
- fetch_header("action_dispatch.request.query_parameters") do |k|
- rack_query_params = super || {}
- controller = path_parameters[:controller]
- action = path_parameters[:action]
- rack_query_params = Request::Utils.set_binary_encoding(self, rack_query_params, controller, action)
-
- Request::Utils.check_param_encoding(rack_query_params)
- set_header k, Request::Utils.normalize_encode_params(rack_query_params)
- end
-rescue Rack::Utils::ParameterTypeError, Rack::Utils::InvalidParameterError, Rack::QueryParser::ParamsTooDeepError => e
- raise ActionController::BadRequest.new("Invalid query parameters: #{e.message}")
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -626,31 +626,31 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 404
+ def POST
+ fetch_header("action_dispatch.request.request_parameters") do
+ pr = parse_formatted_parameters(params_parsers) do |params|
+ super || {}
+ end
+ pr = Request::Utils.set_binary_encoding(self, pr, path_parameters[:controller], path_parameters[:action])
+ Request::Utils.check_param_encoding(pr)
+ self.request_parameters = Request::Utils.normalize_encode_params(pr)
+ end
+ rescue Rack::Utils::ParameterTypeError, Rack::Utils::InvalidParameterError, Rack::QueryParser::ParamsTooDeepError, EOFError => e
+ raise ActionController::BadRequest.new("Invalid request parameters: #{e.message}")
+ end
-
- Source:
-
-
-
-
-def POST
- fetch_header("action_dispatch.request.request_parameters") do
- pr = parse_formatted_parameters(params_parsers) do |params|
- super || {}
- end
- pr = Request::Utils.set_binary_encoding(self, pr, path_parameters[:controller], path_parameters[:action])
- Request::Utils.check_param_encoding(pr)
- self.request_parameters = Request::Utils.normalize_encode_params(pr)
- end
-rescue Rack::Utils::ParameterTypeError, Rack::Utils::InvalidParameterError, Rack::QueryParser::ParamsTooDeepError, EOFError => e
- raise ActionController::BadRequest.new("Invalid request parameters: #{e.message}")
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -670,25 +670,25 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 420
+ def authorization
+ get_header("HTTP_AUTHORIZATION") ||
+ get_header("X-HTTP_AUTHORIZATION") ||
+ get_header("X_HTTP_AUTHORIZATION") ||
+ get_header("REDIRECT_X_HTTP_AUTHORIZATION")
+ end
-
- Source:
-
-
-
-
-def authorization
- get_header("HTTP_AUTHORIZATION") ||
- get_header("X-HTTP_AUTHORIZATION") ||
- get_header("X_HTTP_AUTHORIZATION") ||
- get_header("REDIRECT_X_HTTP_AUTHORIZATION")
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -708,27 +708,27 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 349
+ def body
+ if raw_post = get_header("RAW_POST_DATA")
+ raw_post = (+raw_post).force_encoding(Encoding::BINARY)
+ StringIO.new(raw_post)
+ else
+ body_stream
+ end
+ end
-
- Source:
-
-
-
-
-def body
- if raw_post = get_header("RAW_POST_DATA")
- raw_post = (+raw_post).force_encoding(Encoding::BINARY)
- StringIO.new(raw_post)
- else
- body_stream
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -748,22 +748,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 452
+ def commit_csrf_token
+ controller_instance.commit_csrf_token(self) if controller_instance.respond_to?(:commit_csrf_token)
+ end
-
- Source:
-
-
-
-
-def commit_csrf_token
- controller_instance.commit_csrf_token(self) if controller_instance.respond_to?(:commit_csrf_token)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -783,21 +783,21 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 441
+ def commit_flash
+ end
-
- Source:
-
-
-
-
-def commit_flash
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -817,23 +817,23 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 285
+ def content_length
+ return raw_post.bytesize if headers.key?("Transfer-Encoding")
+ super.to_i
+ end
-
- Source:
-
-
-
-
-def content_length
- return raw_post.bytesize if headers.key?("Transfer-Encoding")
- super.to_i
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -853,24 +853,24 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 79
+ def controller_class
+ params = path_parameters
+ params[:action] ||= "index"
+ controller_class_for(params[:controller])
+ end
-
- Source:
-
-
-
-
-def controller_class
- params = path_parameters
- params[:action] ||= "index"
- controller_class_for(params[:controller])
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -890,36 +890,36 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 85
+ def controller_class_for(name)
+ if name
+ controller_param = name.underscore
+ const_name = controller_param.camelize << "Controller"
+ begin
+ const_name.constantize
+ rescue NameError => error
+ if error.missing_name == const_name || const_name.start_with?("#{error.missing_name}::")
+ raise MissingController.new(error.message, error.name)
+ else
+ raise
+ end
+ end
+ else
+ PASS_NOT_FOUND
+ end
+ end
-
- Source:
-
-
-
-
-def controller_class_for(name)
- if name
- controller_param = name.underscore
- const_name = controller_param.camelize << "Controller"
- begin
- const_name.constantize
- rescue NameError => error
- if error.missing_name == const_name || const_name.start_with?("#{error.missing_name}::")
- raise MissingController.new(error.message, error.name)
- else
- raise
- end
- end
- else
- PASS_NOT_FOUND
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -941,22 +941,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 366
+ def form_data?
+ FORM_DATA_MEDIA_TYPES.include?(media_type)
+ end
-
- Source:
-
-
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -983,22 +983,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 264
+ def fullpath
+ @fullpath ||= super
+ end
-
- Source:
-
-
-
-
-def fullpath
- @fullpath ||= super
-end
-
-
-
-
+ See on GitHub
+
+
+
+
+ See on GitHub
+
+
+
+
@@ -1056,22 +1056,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 190
+ def http_auth_salt
+ get_header "action_dispatch.http_auth_salt"
+ end
-
- Source:
-
-
-
-
-def http_auth_salt
- get_header "action_dispatch.http_auth_salt"
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1091,22 +1091,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 299
+ def ip
+ @ip ||= super
+ end
-
- Source:
-
-
-
-
-def ip
- @ip ||= super
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1129,22 +1129,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 106
+ def key?(key)
+ has_header? key
+ end
-
- Source:
-
-
-
-
-def key?(key)
- has_header? key
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1164,22 +1164,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 428
+ def local?
+ LOCALHOST.match?(remote_addr) && LOCALHOST.match?(remote_ip)
+ end
-
- Source:
-
-
-
-
-def local?
- LOCALHOST.match?(remote_addr) && LOCALHOST.match?(remote_ip)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1199,22 +1199,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 437
+ def logger
+ get_header("action_dispatch.logger")
+ end
-
- Source:
-
-
-
-
-def logger
- get_header("action_dispatch.logger")
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1238,22 +1238,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 280
+ def media_type
+ content_mime_type&.to_s
+ end
-
- Source:
-
-
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1275,29 +1275,29 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 205
+ def method(*args)
+ if args.empty?
+ @method ||= check_method(
+ get_header("rack.methodoverride.original_method") ||
+ get_header("REQUEST_METHOD")
+ )
+ else
+ super
+ end
+ end
-
- Source:
-
-
-
-
-def method(*args)
- if args.empty?
- @method ||= check_method(
- get_header("rack.methodoverride.original_method") ||
- get_header("REQUEST_METHOD")
- )
- else
- super
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1317,22 +1317,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 218
+ def method_symbol
+ HTTP_METHOD_LOOKUP[method]
+ end
-
- Source:
-
-
-
-
-def method_symbol
- HTTP_METHOD_LOOKUP[method]
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1359,22 +1359,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 253
+ def original_fullpath
+ @original_fullpath ||= (get_header("ORIGINAL_FULLPATH") || fullpath)
+ end
-
- Source:
-
-
-
-
-def original_fullpath
- @original_fullpath ||= (get_header("ORIGINAL_FULLPATH") || fullpath)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1398,22 +1398,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 272
+ def original_url
+ base_url + original_fullpath
+ end
-
- Source:
-
-
-
-
-def original_url
- base_url + original_fullpath
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1437,7 +1437,8 @@
-
+
+
@@ -1457,26 +1458,26 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 339
+ def raw_post
+ unless has_header? "RAW_POST_DATA"
+ set_header("RAW_POST_DATA", read_body_stream)
+ body_stream.rewind if body_stream.respond_to?(:rewind)
+ end
+ get_header "RAW_POST_DATA"
+ end
-
- Source:
-
-
-
-
-def raw_post
- unless has_header? "RAW_POST_DATA"
- set_header("RAW_POST_DATA", read_body_stream)
- body_stream.rewind if body_stream.respond_to?(:rewind)
- end
- get_header "RAW_POST_DATA"
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1500,7 +1501,8 @@
-
+
+
@@ -1520,22 +1522,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 305
+ def remote_ip
+ @remote_ip ||= (get_header("action_dispatch.remote_ip") || ip).to_s
+ end
-
- Source:
-
-
-
-
-def remote_ip
- @remote_ip ||= (get_header("action_dispatch.remote_ip") || ip).to_s
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1555,23 +1557,23 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 309
+ def remote_ip=(remote_ip)
+ @remote_ip = nil
+ set_header "action_dispatch.remote_ip", remote_ip
+ end
-
- Source:
-
-
-
-
-def remote_ip=(remote_ip)
- @remote_ip = nil
- set_header "action_dispatch.remote_ip", remote_ip
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1597,22 +1599,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 322
+ def request_id
+ get_header ACTION_DISPATCH_REQUEST_ID
+ end
-
- Source:
-
-
-
-
-def request_id
- get_header ACTION_DISPATCH_REQUEST_ID
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1636,22 +1638,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 144
+ def request_method
+ @request_method ||= check_method(super)
+ end
-
- Source:
-
-
-
-
-def request_method
- @request_method ||= check_method(super)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1671,22 +1673,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 195
+ def request_method_symbol
+ HTTP_METHOD_LOOKUP[request_method]
+ end
-
- Source:
-
-
-
-
-def request_method_symbol
- HTTP_METHOD_LOOKUP[request_method]
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1710,7 +1712,8 @@
-
+
+
@@ -1730,23 +1733,23 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 432
+ def request_parameters=(params)
+ raise if params.nil?
+ set_header("action_dispatch.request.request_parameters", params)
+ end
-
- Source:
-
-
-
-
-def request_parameters=(params)
- raise if params.nil?
- set_header("action_dispatch.request.request_parameters", params)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1766,22 +1769,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 448
+ def reset_csrf_token
+ controller_instance.reset_csrf_token(self) if controller_instance.respond_to?(:reset_csrf_token)
+ end
-
- Source:
-
-
-
-
-def reset_csrf_token
- controller_instance.reset_csrf_token(self) if controller_instance.respond_to?(:reset_csrf_token)
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1801,23 +1804,23 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 374
+ def reset_session
+ session.destroy
+ reset_csrf_token
+ end
-
- Source:
-
-
-
-
-def reset_session
- session.destroy
- reset_csrf_token
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1840,22 +1843,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 152
+ def route_uri_pattern
+ get_header("action_dispatch.route_uri_pattern")
+ end
-
- Source:
-
-
-
-
-def route_uri_pattern
- get_header("action_dispatch.route_uri_pattern")
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1884,24 +1887,24 @@
-
-
-
-
- Source:
-
-
-
-
-def send_early_hints(links)
- return unless env["rack.early_hints"]
+
+
+
+ Source code
+
- env["rack.early_hints"].call(links)
-end
-
-
-
-
+ # File actionpack/lib/action_dispatch/http/request.rb, line 240
+ def send_early_hints(links)
+ return unless env["rack.early_hints"]
+
+ env["rack.early_hints"].call(links)
+ end
+
+ See on GitHub
+
+
+
+
@@ -1921,22 +1924,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 333
+ def server_software
+ (get_header("SERVER_SOFTWARE") && /^([a-zA-Z]+)/ =~ get_header("SERVER_SOFTWARE")) ? $1.downcase : nil
+ end
-
- Source:
-
-
-
-
-def server_software
- (get_header("SERVER_SOFTWARE") && /^([a-zA-Z]+)/ =~ get_header("SERVER_SOFTWARE")) ? $1.downcase : nil
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1956,22 +1959,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 383
+ def session_options=(options)
+ Session::Options.set self, options
+ end
-
- Source:
-
-
-
-
-def session_options=(options)
- Session::Options.set self, options
-end
-
-
-
-
+ See on GitHub
+
+
+
+
@@ -1995,7 +1998,8 @@
-
+
+
@@ -2019,7 +2023,8 @@
-
+
+
@@ -2043,22 +2048,22 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/http/request.rb, line 293
+ def xml_http_request?
+ /XMLHttpRequest/i.match?(get_header("HTTP_X_REQUESTED_WITH"))
+ end
-
- Source:
-
-
-
-
-def xml_http_request?
- /XMLHttpRequest/i.match?(get_header("HTTP_X_REQUESTED_WITH"))
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/RequestCookieMethods.html b/src/classes/ActionDispatch/RequestCookieMethods.html
index f787fbd524..84eaa376ab 100644
--- a/src/classes/ActionDispatch/RequestCookieMethods.html
+++ b/src/classes/ActionDispatch/RequestCookieMethods.html
@@ -75,24 +75,24 @@
-
-
+
+
+
+ Source code
+
+
+ # File actionpack/lib/action_dispatch/middleware/cookies.rb, line 11
+ def cookie_jar
+ fetch_header("action_dispatch.cookies") do
+ self.cookie_jar = Cookies::CookieJar.build(self, cookies)
+ end
+ end
-
- Source:
-
-
-
-
-def cookie_jar
- fetch_header("action_dispatch.cookies") do
- self.cookie_jar = Cookies::CookieJar.build(self, cookies)
- end
-end
-
-
-
-
+ See on GitHub
+
+
+
+
diff --git a/src/classes/ActionDispatch/RequestEncoder/IdentityEncoder.html b/src/classes/ActionDispatch/RequestEncoder/IdentityEncoder.html
index 55d265ce31..374d7476ec 100644
--- a/src/classes/ActionDispatch/RequestEncoder/IdentityEncoder.html
+++ b/src/classes/ActionDispatch/RequestEncoder/IdentityEncoder.html
@@ -93,20 +93,20 @@