actionpack 7.1.3 → 7.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +121 -465
- data/README.rdoc +1 -1
- data/lib/abstract_controller/asset_paths.rb +2 -0
- data/lib/abstract_controller/base.rb +93 -100
- data/lib/abstract_controller/caching/fragments.rb +50 -53
- data/lib/abstract_controller/caching.rb +2 -0
- data/lib/abstract_controller/callbacks.rb +66 -64
- data/lib/abstract_controller/collector.rb +7 -7
- data/lib/abstract_controller/deprecator.rb +2 -0
- data/lib/abstract_controller/error.rb +2 -0
- data/lib/abstract_controller/helpers.rb +71 -84
- data/lib/abstract_controller/logger.rb +2 -0
- data/lib/abstract_controller/railties/routes_helpers.rb +2 -0
- data/lib/abstract_controller/rendering.rb +13 -12
- data/lib/abstract_controller/translation.rb +15 -7
- data/lib/abstract_controller/url_for.rb +8 -6
- data/lib/abstract_controller.rb +2 -0
- data/lib/action_controller/api/api_rendering.rb +2 -0
- data/lib/action_controller/api.rb +75 -72
- data/lib/action_controller/base.rb +198 -126
- data/lib/action_controller/caching.rb +15 -12
- data/lib/action_controller/deprecator.rb +2 -0
- data/lib/action_controller/form_builder.rb +20 -17
- data/lib/action_controller/log_subscriber.rb +3 -1
- data/lib/action_controller/metal/allow_browser.rb +123 -0
- data/lib/action_controller/metal/basic_implicit_render.rb +2 -0
- data/lib/action_controller/metal/conditional_get.rb +187 -174
- data/lib/action_controller/metal/content_security_policy.rb +25 -24
- data/lib/action_controller/metal/cookies.rb +4 -2
- data/lib/action_controller/metal/data_streaming.rb +64 -55
- data/lib/action_controller/metal/default_headers.rb +5 -3
- data/lib/action_controller/metal/etag_with_flash.rb +3 -1
- data/lib/action_controller/metal/etag_with_template_digest.rb +17 -15
- data/lib/action_controller/metal/exceptions.rb +11 -9
- data/lib/action_controller/metal/flash.rb +12 -10
- data/lib/action_controller/metal/head.rb +12 -10
- data/lib/action_controller/metal/helpers.rb +63 -55
- data/lib/action_controller/metal/http_authentication.rb +211 -206
- data/lib/action_controller/metal/implicit_render.rb +17 -15
- data/lib/action_controller/metal/instrumentation.rb +15 -12
- data/lib/action_controller/metal/live.rb +117 -108
- data/lib/action_controller/metal/logging.rb +6 -4
- data/lib/action_controller/metal/mime_responds.rb +151 -142
- data/lib/action_controller/metal/parameter_encoding.rb +34 -32
- data/lib/action_controller/metal/params_wrapper.rb +57 -59
- data/lib/action_controller/metal/permissions_policy.rb +13 -12
- data/lib/action_controller/metal/rate_limiting.rb +62 -0
- data/lib/action_controller/metal/redirecting.rb +112 -85
- data/lib/action_controller/metal/renderers.rb +50 -49
- data/lib/action_controller/metal/rendering.rb +104 -76
- data/lib/action_controller/metal/request_forgery_protection.rb +165 -134
- data/lib/action_controller/metal/rescue.rb +11 -9
- data/lib/action_controller/metal/streaming.rb +138 -136
- data/lib/action_controller/metal/strong_parameters.rb +525 -483
- data/lib/action_controller/metal/testing.rb +2 -0
- data/lib/action_controller/metal/url_for.rb +17 -15
- data/lib/action_controller/metal.rb +86 -60
- data/lib/action_controller/railtie.rb +3 -0
- data/lib/action_controller/railties/helpers.rb +2 -0
- data/lib/action_controller/renderer.rb +41 -36
- data/lib/action_controller/template_assertions.rb +4 -2
- data/lib/action_controller/test_case.rb +148 -129
- data/lib/action_controller.rb +10 -3
- data/lib/action_dispatch/constants.rb +8 -0
- data/lib/action_dispatch/deprecator.rb +2 -0
- data/lib/action_dispatch/http/cache.rb +27 -26
- data/lib/action_dispatch/http/content_disposition.rb +2 -0
- data/lib/action_dispatch/http/content_security_policy.rb +61 -42
- data/lib/action_dispatch/http/filter_parameters.rb +18 -9
- data/lib/action_dispatch/http/filter_redirect.rb +22 -1
- data/lib/action_dispatch/http/headers.rb +22 -22
- data/lib/action_dispatch/http/mime_negotiation.rb +35 -41
- data/lib/action_dispatch/http/mime_type.rb +31 -24
- data/lib/action_dispatch/http/mime_types.rb +2 -0
- data/lib/action_dispatch/http/parameters.rb +11 -9
- data/lib/action_dispatch/http/permissions_policy.rb +20 -44
- data/lib/action_dispatch/http/rack_cache.rb +2 -0
- data/lib/action_dispatch/http/request.rb +96 -76
- data/lib/action_dispatch/http/response.rb +88 -62
- data/lib/action_dispatch/http/upload.rb +18 -16
- data/lib/action_dispatch/http/url.rb +77 -75
- data/lib/action_dispatch/journey/formatter.rb +21 -9
- data/lib/action_dispatch/journey/gtg/builder.rb +4 -3
- data/lib/action_dispatch/journey/gtg/simulator.rb +2 -0
- data/lib/action_dispatch/journey/gtg/transition_table.rb +14 -12
- data/lib/action_dispatch/journey/nfa/dot.rb +2 -0
- data/lib/action_dispatch/journey/nodes/node.rb +6 -5
- data/lib/action_dispatch/journey/parser.rb +4 -3
- data/lib/action_dispatch/journey/parser_extras.rb +2 -0
- data/lib/action_dispatch/journey/path/pattern.rb +4 -1
- data/lib/action_dispatch/journey/route.rb +9 -7
- data/lib/action_dispatch/journey/router/utils.rb +16 -15
- data/lib/action_dispatch/journey/router.rb +4 -2
- data/lib/action_dispatch/journey/routes.rb +4 -2
- data/lib/action_dispatch/journey/scanner.rb +4 -2
- data/lib/action_dispatch/journey/visitors.rb +2 -0
- data/lib/action_dispatch/journey.rb +2 -0
- data/lib/action_dispatch/log_subscriber.rb +2 -0
- data/lib/action_dispatch/middleware/actionable_exceptions.rb +2 -0
- data/lib/action_dispatch/middleware/assume_ssl.rb +8 -5
- data/lib/action_dispatch/middleware/callbacks.rb +3 -1
- data/lib/action_dispatch/middleware/cookies.rb +119 -104
- data/lib/action_dispatch/middleware/debug_exceptions.rb +16 -6
- data/lib/action_dispatch/middleware/debug_locks.rb +15 -13
- data/lib/action_dispatch/middleware/debug_view.rb +2 -0
- data/lib/action_dispatch/middleware/exception_wrapper.rb +9 -14
- data/lib/action_dispatch/middleware/executor.rb +13 -2
- data/lib/action_dispatch/middleware/flash.rb +63 -51
- data/lib/action_dispatch/middleware/host_authorization.rb +17 -15
- data/lib/action_dispatch/middleware/public_exceptions.rb +13 -7
- data/lib/action_dispatch/middleware/reloader.rb +5 -3
- data/lib/action_dispatch/middleware/remote_ip.rb +76 -72
- data/lib/action_dispatch/middleware/request_id.rb +14 -9
- data/lib/action_dispatch/middleware/server_timing.rb +4 -2
- data/lib/action_dispatch/middleware/session/abstract_store.rb +2 -0
- data/lib/action_dispatch/middleware/session/cache_store.rb +13 -8
- data/lib/action_dispatch/middleware/session/cookie_store.rb +27 -26
- data/lib/action_dispatch/middleware/session/mem_cache_store.rb +7 -3
- data/lib/action_dispatch/middleware/show_exceptions.rb +31 -21
- data/lib/action_dispatch/middleware/ssl.rb +43 -40
- data/lib/action_dispatch/middleware/stack.rb +11 -10
- data/lib/action_dispatch/middleware/static.rb +33 -31
- data/lib/action_dispatch/middleware/templates/rescues/_source.html.erb +1 -1
- data/lib/action_dispatch/middleware/templates/rescues/missing_exact_template.html.erb +1 -1
- data/lib/action_dispatch/middleware/templates/routes/_table.html.erb +1 -1
- data/lib/action_dispatch/railtie.rb +2 -4
- data/lib/action_dispatch/request/session.rb +23 -21
- data/lib/action_dispatch/request/utils.rb +2 -0
- data/lib/action_dispatch/routing/endpoint.rb +2 -0
- data/lib/action_dispatch/routing/inspector.rb +6 -4
- data/lib/action_dispatch/routing/mapper.rb +673 -637
- data/lib/action_dispatch/routing/polymorphic_routes.rb +69 -62
- data/lib/action_dispatch/routing/redirection.rb +37 -32
- data/lib/action_dispatch/routing/route_set.rb +60 -46
- data/lib/action_dispatch/routing/routes_proxy.rb +6 -4
- data/lib/action_dispatch/routing/url_for.rb +130 -125
- data/lib/action_dispatch/routing.rb +150 -148
- data/lib/action_dispatch/system_test_case.rb +91 -81
- data/lib/action_dispatch/system_testing/browser.rb +10 -3
- data/lib/action_dispatch/system_testing/driver.rb +3 -1
- data/lib/action_dispatch/system_testing/server.rb +2 -0
- data/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb +32 -21
- data/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb +2 -0
- data/lib/action_dispatch/testing/assertion_response.rb +9 -7
- data/lib/action_dispatch/testing/assertions/response.rb +26 -23
- data/lib/action_dispatch/testing/assertions/routing.rb +153 -84
- data/lib/action_dispatch/testing/assertions.rb +2 -0
- data/lib/action_dispatch/testing/integration.rb +222 -222
- data/lib/action_dispatch/testing/request_encoder.rb +11 -9
- data/lib/action_dispatch/testing/test_helpers/page_dump_helper.rb +35 -0
- data/lib/action_dispatch/testing/test_process.rb +11 -8
- data/lib/action_dispatch/testing/test_request.rb +3 -1
- data/lib/action_dispatch/testing/test_response.rb +27 -26
- data/lib/action_dispatch.rb +25 -27
- data/lib/action_pack/gem_version.rb +4 -2
- data/lib/action_pack/version.rb +3 -1
- data/lib/action_pack.rb +17 -16
- metadata +50 -16
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
# :markup: markdown
|
|
4
|
+
|
|
3
5
|
require "nokogiri"
|
|
6
|
+
require "action_dispatch/http/mime_type"
|
|
4
7
|
|
|
5
8
|
module ActionDispatch
|
|
6
9
|
class RequestEncoder # :nodoc:
|
|
@@ -13,9 +16,9 @@ module ActionDispatch
|
|
|
13
16
|
|
|
14
17
|
@encoders = { identity: IdentityEncoder.new }
|
|
15
18
|
|
|
16
|
-
attr_reader :response_parser
|
|
19
|
+
attr_reader :response_parser, :content_type
|
|
17
20
|
|
|
18
|
-
def initialize(mime_name, param_encoder, response_parser)
|
|
21
|
+
def initialize(mime_name, param_encoder, response_parser, content_type)
|
|
19
22
|
@mime = Mime[mime_name]
|
|
20
23
|
|
|
21
24
|
unless @mime
|
|
@@ -25,10 +28,7 @@ module ActionDispatch
|
|
|
25
28
|
|
|
26
29
|
@response_parser = response_parser || -> body { body }
|
|
27
30
|
@param_encoder = param_encoder || :"to_#{@mime.symbol}".to_proc
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
def content_type
|
|
31
|
-
@mime.to_s
|
|
31
|
+
@content_type = content_type || @mime.to_s
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
def accept_header
|
|
@@ -48,11 +48,13 @@ module ActionDispatch
|
|
|
48
48
|
@encoders[name] || @encoders[:identity]
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
-
def self.register_encoder(mime_name, param_encoder: nil, response_parser: nil)
|
|
52
|
-
@encoders[mime_name] = new(mime_name, param_encoder, response_parser)
|
|
51
|
+
def self.register_encoder(mime_name, param_encoder: nil, response_parser: nil, content_type: nil)
|
|
52
|
+
@encoders[mime_name] = new(mime_name, param_encoder, response_parser, content_type)
|
|
53
53
|
end
|
|
54
54
|
|
|
55
|
-
register_encoder :html, response_parser: -> body { Rails::Dom::Testing.html_document.parse(body) }
|
|
55
|
+
register_encoder :html, response_parser: -> body { Rails::Dom::Testing.html_document.parse(body) },
|
|
56
|
+
param_encoder: -> param { param },
|
|
57
|
+
content_type: Mime[:url_encoded_form].to_s
|
|
56
58
|
register_encoder :json, response_parser: -> body { JSON.parse(body, object_class: ActiveSupport::HashWithIndifferentAccess) }
|
|
57
59
|
end
|
|
58
60
|
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module ActionDispatch
|
|
4
|
+
module TestHelpers
|
|
5
|
+
module PageDumpHelper
|
|
6
|
+
class InvalidResponse < StandardError; end
|
|
7
|
+
|
|
8
|
+
# Saves the content of response body to a file and tries to open it in your browser.
|
|
9
|
+
# Launchy must be present in your Gemfile for the page to open automatically.
|
|
10
|
+
def save_and_open_page(path = html_dump_default_path)
|
|
11
|
+
save_page(path).tap { |s_path| open_file(s_path) }
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
private
|
|
15
|
+
def save_page(path = html_dump_default_path)
|
|
16
|
+
raise InvalidResponse.new("Response is a redirection!") if response.redirection?
|
|
17
|
+
path = Pathname.new(path)
|
|
18
|
+
path.dirname.mkpath
|
|
19
|
+
File.write(path, response.body)
|
|
20
|
+
path
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def open_file(path)
|
|
24
|
+
require "launchy"
|
|
25
|
+
Launchy.open(path)
|
|
26
|
+
rescue LoadError
|
|
27
|
+
warn "File saved to #{path}.\nPlease install the launchy gem to open the file automatically."
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def html_dump_default_path
|
|
31
|
+
Rails.root.join("tmp/html_dump", "#{method_name}_#{DateTime.current.to_i}.html").to_s
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
# :markup: markdown
|
|
4
|
+
|
|
3
5
|
require "action_dispatch/middleware/cookies"
|
|
4
6
|
require "action_dispatch/middleware/flash"
|
|
5
7
|
|
|
6
8
|
module ActionDispatch
|
|
7
9
|
module TestProcess
|
|
8
10
|
module FixtureFile
|
|
9
|
-
# Shortcut for
|
|
11
|
+
# Shortcut for
|
|
12
|
+
# `Rack::Test::UploadedFile.new(File.join(ActionDispatch::IntegrationTest.file_fixture_path, path), type)`:
|
|
10
13
|
#
|
|
11
|
-
#
|
|
14
|
+
# post :change_avatar, params: { avatar: file_fixture_upload('david.png', 'image/png') }
|
|
12
15
|
#
|
|
13
|
-
# Default fixture files location is
|
|
16
|
+
# Default fixture files location is `test/fixtures/files`.
|
|
14
17
|
#
|
|
15
|
-
# To upload binary files on Windows, pass
|
|
16
|
-
#
|
|
18
|
+
# To upload binary files on Windows, pass `:binary` as the last parameter. This
|
|
19
|
+
# will not affect other platforms:
|
|
17
20
|
#
|
|
18
|
-
#
|
|
21
|
+
# post :change_avatar, params: { avatar: file_fixture_upload('david.png', 'image/png', :binary) }
|
|
19
22
|
def file_fixture_upload(path, mime_type = nil, binary = false)
|
|
20
23
|
if self.class.file_fixture_path && !File.exist?(path)
|
|
21
24
|
path = file_fixture(path)
|
|
@@ -30,8 +33,8 @@ module ActionDispatch
|
|
|
30
33
|
|
|
31
34
|
def assigns(key = nil)
|
|
32
35
|
raise NoMethodError,
|
|
33
|
-
|
|
34
|
-
add `gem
|
|
36
|
+
'assigns has been extracted to a gem. To continue using it,
|
|
37
|
+
add `gem "rails-controller-testing"` to your Gemfile.'
|
|
35
38
|
end
|
|
36
39
|
|
|
37
40
|
def session
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
# :markup: markdown
|
|
4
|
+
|
|
3
5
|
require "active_support/core_ext/hash/indifferent_access"
|
|
4
6
|
require "rack/utils"
|
|
5
7
|
|
|
@@ -11,7 +13,7 @@ module ActionDispatch
|
|
|
11
13
|
"HTTP_USER_AGENT" => "Rails Testing".b,
|
|
12
14
|
)
|
|
13
15
|
|
|
14
|
-
# Create a new test request with default
|
|
16
|
+
# Create a new test request with default `env` values.
|
|
15
17
|
def self.create(env = {})
|
|
16
18
|
env = Rails.application.env_config.merge(env) if defined?(Rails.application) && Rails.application
|
|
17
19
|
env["rack.request.cookie_hash"] ||= {}.with_indifferent_access
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
# :markup: markdown
|
|
4
|
+
|
|
3
5
|
require "action_dispatch/testing/request_encoder"
|
|
4
6
|
|
|
5
7
|
module ActionDispatch
|
|
6
|
-
# Integration test methods such as Integration::RequestHelpers#get
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
# controller actions.
|
|
8
|
+
# Integration test methods such as Integration::RequestHelpers#get and
|
|
9
|
+
# Integration::RequestHelpers#post return objects of class TestResponse, which
|
|
10
|
+
# represent the HTTP response results of the requested controller actions.
|
|
10
11
|
#
|
|
11
12
|
# See Response for more information on controller response objects.
|
|
12
13
|
class TestResponse < Response
|
|
@@ -17,35 +18,35 @@ module ActionDispatch
|
|
|
17
18
|
# Returns a parsed body depending on the response MIME type. When a parser
|
|
18
19
|
# corresponding to the MIME type is not found, it returns the raw body.
|
|
19
20
|
#
|
|
20
|
-
#
|
|
21
|
-
#
|
|
22
|
-
#
|
|
23
|
-
#
|
|
24
|
-
#
|
|
21
|
+
# #### Examples
|
|
22
|
+
# get "/posts"
|
|
23
|
+
# response.content_type # => "text/html; charset=utf-8"
|
|
24
|
+
# response.parsed_body.class # => Nokogiri::HTML5::Document
|
|
25
|
+
# response.parsed_body.to_html # => "<!DOCTYPE html>\n<html>\n..."
|
|
25
26
|
#
|
|
26
|
-
#
|
|
27
|
+
# assert_pattern { response.parsed_body.at("main") => { content: "Hello, world" } }
|
|
27
28
|
#
|
|
28
|
-
#
|
|
29
|
-
#
|
|
30
|
-
#
|
|
29
|
+
# response.parsed_body.at("main") => {name:, content:}
|
|
30
|
+
# assert_equal "main", name
|
|
31
|
+
# assert_equal "Some main content", content
|
|
31
32
|
#
|
|
32
|
-
#
|
|
33
|
-
#
|
|
34
|
-
#
|
|
35
|
-
#
|
|
33
|
+
# get "/posts.json"
|
|
34
|
+
# response.content_type # => "application/json; charset=utf-8"
|
|
35
|
+
# response.parsed_body.class # => Array
|
|
36
|
+
# response.parsed_body # => [{"id"=>42, "title"=>"Title"},...
|
|
36
37
|
#
|
|
37
|
-
#
|
|
38
|
+
# assert_pattern { response.parsed_body => [{ id: 42 }] }
|
|
38
39
|
#
|
|
39
|
-
#
|
|
40
|
-
#
|
|
41
|
-
#
|
|
42
|
-
#
|
|
40
|
+
# get "/posts/42.json"
|
|
41
|
+
# response.content_type # => "application/json; charset=utf-8"
|
|
42
|
+
# response.parsed_body.class # => ActiveSupport::HashWithIndifferentAccess
|
|
43
|
+
# response.parsed_body # => {"id"=>42, "title"=>"Title"}
|
|
43
44
|
#
|
|
44
|
-
#
|
|
45
|
+
# assert_pattern { response.parsed_body => [{ title: /title/i }] }
|
|
45
46
|
#
|
|
46
|
-
#
|
|
47
|
-
#
|
|
48
|
-
#
|
|
47
|
+
# response.parsed_body => {id:, title:}
|
|
48
|
+
# assert_equal 42, id
|
|
49
|
+
# assert_equal "Title", title
|
|
49
50
|
def parsed_body
|
|
50
51
|
@parsed_body ||= response_parser.call(body)
|
|
51
52
|
end
|
data/lib/action_dispatch.rb
CHANGED
|
@@ -3,55 +3,53 @@
|
|
|
3
3
|
#--
|
|
4
4
|
# Copyright (c) David Heinemeier Hansson
|
|
5
5
|
#
|
|
6
|
-
# Permission is hereby granted, free of charge, to any person obtaining
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
# the following conditions:
|
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
# furnished to do so, subject to the following conditions:
|
|
13
12
|
#
|
|
14
|
-
# The above copyright notice and this permission notice shall be
|
|
15
|
-
#
|
|
13
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
# copies or substantial portions of the Software.
|
|
16
15
|
#
|
|
17
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
18
|
-
#
|
|
19
|
-
#
|
|
20
|
-
#
|
|
21
|
-
#
|
|
22
|
-
# OF
|
|
23
|
-
#
|
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
# SOFTWARE.
|
|
24
23
|
#++
|
|
25
24
|
|
|
25
|
+
# :markup: markdown
|
|
26
|
+
|
|
26
27
|
require "active_support"
|
|
27
28
|
require "active_support/rails"
|
|
28
29
|
require "active_support/core_ext/module/attribute_accessors"
|
|
29
30
|
|
|
30
31
|
require "action_pack"
|
|
31
32
|
require "rack"
|
|
33
|
+
require "uri"
|
|
32
34
|
require "action_dispatch/deprecator"
|
|
33
35
|
|
|
34
36
|
module Rack # :nodoc:
|
|
35
37
|
autoload :Test, "rack/test"
|
|
36
38
|
end
|
|
37
39
|
|
|
38
|
-
#
|
|
40
|
+
# # Action Dispatch
|
|
39
41
|
#
|
|
40
42
|
# Action Dispatch is a module of Action Pack.
|
|
41
43
|
#
|
|
42
|
-
# Action Dispatch parses information about the web request, handles
|
|
43
|
-
#
|
|
44
|
-
#
|
|
45
|
-
#
|
|
44
|
+
# Action Dispatch parses information about the web request, handles routing as
|
|
45
|
+
# defined by the user, and does advanced processing related to HTTP such as
|
|
46
|
+
# MIME-type negotiation, decoding parameters in POST, PATCH, or PUT bodies,
|
|
47
|
+
# handling HTTP caching logic, cookies and sessions.
|
|
46
48
|
module ActionDispatch
|
|
47
|
-
include ActiveSupport::Deprecation::DeprecatedConstantAccessor
|
|
48
49
|
extend ActiveSupport::Autoload
|
|
49
50
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
deprecate_constant "IllegalStateError", "ActionDispatch::DeprecatedIllegalStateError",
|
|
53
|
-
message: "ActionDispatch::IllegalStateError is deprecated without replacement.",
|
|
54
|
-
deprecator: ActionDispatch.deprecator
|
|
51
|
+
RFC2396_PARSER = defined?(URI::RFC2396_PARSER) ? URI::RFC2396_PARSER : URI::RFC2396_Parser.new
|
|
52
|
+
private_constant :RFC2396_PARSER
|
|
55
53
|
|
|
56
54
|
class MissingController < NameError
|
|
57
55
|
end
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
# :markup: markdown
|
|
4
|
+
|
|
3
5
|
module ActionPack
|
|
4
|
-
# Returns the currently loaded version of Action Pack as a
|
|
6
|
+
# Returns the currently loaded version of Action Pack as a `Gem::Version`.
|
|
5
7
|
def self.gem_version
|
|
6
8
|
Gem::Version.new VERSION::STRING
|
|
7
9
|
end
|
|
8
10
|
|
|
9
11
|
module VERSION
|
|
10
12
|
MAJOR = 7
|
|
11
|
-
MINOR =
|
|
13
|
+
MINOR = 2
|
|
12
14
|
TINY = 3
|
|
13
15
|
PRE = nil
|
|
14
16
|
|
data/lib/action_pack/version.rb
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
# :markup: markdown
|
|
4
|
+
|
|
3
5
|
require_relative "gem_version"
|
|
4
6
|
|
|
5
7
|
module ActionPack
|
|
6
|
-
# Returns the currently loaded version of Action Pack as a
|
|
8
|
+
# Returns the currently loaded version of Action Pack as a `Gem::Version`.
|
|
7
9
|
def self.version
|
|
8
10
|
gem_version
|
|
9
11
|
end
|
data/lib/action_pack.rb
CHANGED
|
@@ -3,24 +3,25 @@
|
|
|
3
3
|
#--
|
|
4
4
|
# Copyright (c) David Heinemeier Hansson
|
|
5
5
|
#
|
|
6
|
-
# Permission is hereby granted, free of charge, to any person obtaining
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
# the following conditions:
|
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
# furnished to do so, subject to the following conditions:
|
|
13
12
|
#
|
|
14
|
-
# The above copyright notice and this permission notice shall be
|
|
15
|
-
#
|
|
13
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
# copies or substantial portions of the Software.
|
|
16
15
|
#
|
|
17
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
18
|
-
#
|
|
19
|
-
#
|
|
20
|
-
#
|
|
21
|
-
#
|
|
22
|
-
# OF
|
|
23
|
-
#
|
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
# SOFTWARE.
|
|
24
23
|
#++
|
|
25
24
|
|
|
25
|
+
# :markup: markdown
|
|
26
|
+
|
|
26
27
|
require "action_pack/version"
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: actionpack
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 7.
|
|
4
|
+
version: 7.2.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Heinemeier Hansson
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: activesupport
|
|
@@ -16,14 +15,28 @@ dependencies:
|
|
|
16
15
|
requirements:
|
|
17
16
|
- - '='
|
|
18
17
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 7.
|
|
18
|
+
version: 7.2.3
|
|
20
19
|
type: :runtime
|
|
21
20
|
prerelease: false
|
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
22
|
requirements:
|
|
24
23
|
- - '='
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: 7.
|
|
25
|
+
version: 7.2.3
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: cgi
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '0'
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '0'
|
|
27
40
|
- !ruby/object:Gem::Dependency
|
|
28
41
|
name: nokogiri
|
|
29
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -59,6 +72,9 @@ dependencies:
|
|
|
59
72
|
- - ">="
|
|
60
73
|
- !ruby/object:Gem::Version
|
|
61
74
|
version: 2.2.4
|
|
75
|
+
- - "<"
|
|
76
|
+
- !ruby/object:Gem::Version
|
|
77
|
+
version: '3.3'
|
|
62
78
|
type: :runtime
|
|
63
79
|
prerelease: false
|
|
64
80
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -66,6 +82,9 @@ dependencies:
|
|
|
66
82
|
- - ">="
|
|
67
83
|
- !ruby/object:Gem::Version
|
|
68
84
|
version: 2.2.4
|
|
85
|
+
- - "<"
|
|
86
|
+
- !ruby/object:Gem::Version
|
|
87
|
+
version: '3.3'
|
|
69
88
|
- !ruby/object:Gem::Dependency
|
|
70
89
|
name: rack-session
|
|
71
90
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -122,34 +141,48 @@ dependencies:
|
|
|
122
141
|
- - "~>"
|
|
123
142
|
- !ruby/object:Gem::Version
|
|
124
143
|
version: '2.2'
|
|
144
|
+
- !ruby/object:Gem::Dependency
|
|
145
|
+
name: useragent
|
|
146
|
+
requirement: !ruby/object:Gem::Requirement
|
|
147
|
+
requirements:
|
|
148
|
+
- - "~>"
|
|
149
|
+
- !ruby/object:Gem::Version
|
|
150
|
+
version: '0.16'
|
|
151
|
+
type: :runtime
|
|
152
|
+
prerelease: false
|
|
153
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
154
|
+
requirements:
|
|
155
|
+
- - "~>"
|
|
156
|
+
- !ruby/object:Gem::Version
|
|
157
|
+
version: '0.16'
|
|
125
158
|
- !ruby/object:Gem::Dependency
|
|
126
159
|
name: actionview
|
|
127
160
|
requirement: !ruby/object:Gem::Requirement
|
|
128
161
|
requirements:
|
|
129
162
|
- - '='
|
|
130
163
|
- !ruby/object:Gem::Version
|
|
131
|
-
version: 7.
|
|
164
|
+
version: 7.2.3
|
|
132
165
|
type: :runtime
|
|
133
166
|
prerelease: false
|
|
134
167
|
version_requirements: !ruby/object:Gem::Requirement
|
|
135
168
|
requirements:
|
|
136
169
|
- - '='
|
|
137
170
|
- !ruby/object:Gem::Version
|
|
138
|
-
version: 7.
|
|
171
|
+
version: 7.2.3
|
|
139
172
|
- !ruby/object:Gem::Dependency
|
|
140
173
|
name: activemodel
|
|
141
174
|
requirement: !ruby/object:Gem::Requirement
|
|
142
175
|
requirements:
|
|
143
176
|
- - '='
|
|
144
177
|
- !ruby/object:Gem::Version
|
|
145
|
-
version: 7.
|
|
178
|
+
version: 7.2.3
|
|
146
179
|
type: :development
|
|
147
180
|
prerelease: false
|
|
148
181
|
version_requirements: !ruby/object:Gem::Requirement
|
|
149
182
|
requirements:
|
|
150
183
|
- - '='
|
|
151
184
|
- !ruby/object:Gem::Version
|
|
152
|
-
version: 7.
|
|
185
|
+
version: 7.2.3
|
|
153
186
|
description: Web apps on Rails. Simple, battle-tested conventions for building and
|
|
154
187
|
testing MVC web applications. Works with any Rack-compatible server.
|
|
155
188
|
email: david@loudthinking.com
|
|
@@ -184,6 +217,7 @@ files:
|
|
|
184
217
|
- lib/action_controller/form_builder.rb
|
|
185
218
|
- lib/action_controller/log_subscriber.rb
|
|
186
219
|
- lib/action_controller/metal.rb
|
|
220
|
+
- lib/action_controller/metal/allow_browser.rb
|
|
187
221
|
- lib/action_controller/metal/basic_implicit_render.rb
|
|
188
222
|
- lib/action_controller/metal/conditional_get.rb
|
|
189
223
|
- lib/action_controller/metal/content_security_policy.rb
|
|
@@ -205,6 +239,7 @@ files:
|
|
|
205
239
|
- lib/action_controller/metal/parameter_encoding.rb
|
|
206
240
|
- lib/action_controller/metal/params_wrapper.rb
|
|
207
241
|
- lib/action_controller/metal/permissions_policy.rb
|
|
242
|
+
- lib/action_controller/metal/rate_limiting.rb
|
|
208
243
|
- lib/action_controller/metal/redirecting.rb
|
|
209
244
|
- lib/action_controller/metal/renderers.rb
|
|
210
245
|
- lib/action_controller/metal/rendering.rb
|
|
@@ -335,6 +370,7 @@ files:
|
|
|
335
370
|
- lib/action_dispatch/testing/assertions/routing.rb
|
|
336
371
|
- lib/action_dispatch/testing/integration.rb
|
|
337
372
|
- lib/action_dispatch/testing/request_encoder.rb
|
|
373
|
+
- lib/action_dispatch/testing/test_helpers/page_dump_helper.rb
|
|
338
374
|
- lib/action_dispatch/testing/test_process.rb
|
|
339
375
|
- lib/action_dispatch/testing/test_request.rb
|
|
340
376
|
- lib/action_dispatch/testing/test_response.rb
|
|
@@ -346,12 +382,11 @@ licenses:
|
|
|
346
382
|
- MIT
|
|
347
383
|
metadata:
|
|
348
384
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
|
349
|
-
changelog_uri: https://github.com/rails/rails/blob/v7.
|
|
350
|
-
documentation_uri: https://api.rubyonrails.org/v7.
|
|
385
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.2.3/actionpack/CHANGELOG.md
|
|
386
|
+
documentation_uri: https://api.rubyonrails.org/v7.2.3/
|
|
351
387
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
|
352
|
-
source_code_uri: https://github.com/rails/rails/tree/v7.
|
|
388
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.2.3/actionpack
|
|
353
389
|
rubygems_mfa_required: 'true'
|
|
354
|
-
post_install_message:
|
|
355
390
|
rdoc_options: []
|
|
356
391
|
require_paths:
|
|
357
392
|
- lib
|
|
@@ -359,7 +394,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
359
394
|
requirements:
|
|
360
395
|
- - ">="
|
|
361
396
|
- !ruby/object:Gem::Version
|
|
362
|
-
version:
|
|
397
|
+
version: 3.1.0
|
|
363
398
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
364
399
|
requirements:
|
|
365
400
|
- - ">="
|
|
@@ -367,8 +402,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
367
402
|
version: '0'
|
|
368
403
|
requirements:
|
|
369
404
|
- none
|
|
370
|
-
rubygems_version: 3.
|
|
371
|
-
signing_key:
|
|
405
|
+
rubygems_version: 3.6.9
|
|
372
406
|
specification_version: 4
|
|
373
407
|
summary: Web-flow and rendering framework putting the VC in MVC (part of Rails).
|
|
374
408
|
test_files: []
|