actionpack 5.2.4 → 6.0.2.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of actionpack might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +200 -317
- data/MIT-LICENSE +1 -1
- data/README.rdoc +3 -2
- data/lib/abstract_controller/base.rb +4 -2
- data/lib/abstract_controller/caching/fragments.rb +6 -22
- data/lib/abstract_controller/callbacks.rb +12 -0
- data/lib/abstract_controller/collector.rb +1 -1
- data/lib/abstract_controller/helpers.rb +2 -2
- data/lib/abstract_controller/railties/routes_helpers.rb +1 -1
- data/lib/abstract_controller/translation.rb +1 -0
- data/lib/action_controller.rb +5 -1
- data/lib/action_controller/api.rb +2 -1
- data/lib/action_controller/base.rb +2 -7
- data/lib/action_controller/caching.rb +1 -1
- data/lib/action_controller/log_subscriber.rb +8 -5
- data/lib/action_controller/metal.rb +1 -1
- data/lib/action_controller/metal/basic_implicit_render.rb +1 -1
- data/lib/action_controller/metal/conditional_get.rb +9 -3
- data/lib/action_controller/metal/data_streaming.rb +5 -6
- data/lib/action_controller/metal/default_headers.rb +17 -0
- data/lib/action_controller/metal/etag_with_template_digest.rb +1 -1
- data/lib/action_controller/metal/exceptions.rb +23 -2
- data/lib/action_controller/metal/flash.rb +5 -5
- data/lib/action_controller/metal/force_ssl.rb +15 -56
- data/lib/action_controller/metal/head.rb +1 -1
- data/lib/action_controller/metal/helpers.rb +3 -4
- data/lib/action_controller/metal/http_authentication.rb +20 -21
- data/lib/action_controller/metal/implicit_render.rb +4 -14
- data/lib/action_controller/metal/instrumentation.rb +3 -5
- data/lib/action_controller/metal/live.rb +29 -27
- data/lib/action_controller/metal/mime_responds.rb +13 -2
- data/lib/action_controller/metal/params_wrapper.rb +17 -13
- data/lib/action_controller/metal/redirecting.rb +5 -5
- data/lib/action_controller/metal/renderers.rb +4 -4
- data/lib/action_controller/metal/rendering.rb +2 -2
- data/lib/action_controller/metal/request_forgery_protection.rb +23 -12
- data/lib/action_controller/metal/strong_parameters.rb +63 -44
- data/lib/action_controller/metal/url_for.rb +1 -1
- data/lib/action_controller/railties/helpers.rb +1 -1
- data/lib/action_controller/renderer.rb +16 -3
- data/lib/action_controller/template_assertions.rb +1 -1
- data/lib/action_controller/test_case.rb +2 -5
- data/lib/action_dispatch.rb +9 -6
- data/lib/action_dispatch/http/cache.rb +14 -10
- data/lib/action_dispatch/http/content_disposition.rb +45 -0
- data/lib/action_dispatch/http/content_security_policy.rb +28 -16
- data/lib/action_dispatch/http/filter_parameters.rb +8 -6
- data/lib/action_dispatch/http/filter_redirect.rb +1 -1
- data/lib/action_dispatch/http/headers.rb +1 -1
- data/lib/action_dispatch/http/mime_negotiation.rb +7 -5
- data/lib/action_dispatch/http/mime_type.rb +14 -6
- data/lib/action_dispatch/http/parameter_filter.rb +5 -79
- data/lib/action_dispatch/http/parameters.rb +13 -3
- data/lib/action_dispatch/http/request.rb +10 -13
- data/lib/action_dispatch/http/response.rb +40 -20
- data/lib/action_dispatch/http/upload.rb +9 -1
- data/lib/action_dispatch/http/url.rb +81 -81
- data/lib/action_dispatch/journey/formatter.rb +2 -2
- data/lib/action_dispatch/journey/nfa/simulator.rb +0 -2
- data/lib/action_dispatch/journey/nodes/node.rb +9 -8
- data/lib/action_dispatch/journey/path/pattern.rb +6 -2
- data/lib/action_dispatch/journey/route.rb +5 -4
- data/lib/action_dispatch/journey/router.rb +0 -3
- data/lib/action_dispatch/journey/router/utils.rb +10 -10
- data/lib/action_dispatch/journey/routes.rb +0 -1
- data/lib/action_dispatch/journey/scanner.rb +11 -4
- data/lib/action_dispatch/journey/visitors.rb +1 -1
- data/lib/action_dispatch/middleware/actionable_exceptions.rb +39 -0
- data/lib/action_dispatch/middleware/callbacks.rb +2 -4
- data/lib/action_dispatch/middleware/cookies.rb +52 -74
- data/lib/action_dispatch/middleware/debug_exceptions.rb +39 -59
- data/lib/action_dispatch/middleware/debug_locks.rb +5 -5
- data/lib/action_dispatch/middleware/debug_view.rb +68 -0
- data/lib/action_dispatch/middleware/exception_wrapper.rb +49 -15
- data/lib/action_dispatch/middleware/flash.rb +1 -1
- data/lib/action_dispatch/middleware/host_authorization.rb +103 -0
- data/lib/action_dispatch/middleware/public_exceptions.rb +6 -2
- data/lib/action_dispatch/middleware/remote_ip.rb +9 -11
- data/lib/action_dispatch/middleware/request_id.rb +2 -2
- data/lib/action_dispatch/middleware/session/abstract_store.rb +14 -0
- data/lib/action_dispatch/middleware/session/cache_store.rb +11 -6
- data/lib/action_dispatch/middleware/session/cookie_store.rb +18 -13
- data/lib/action_dispatch/middleware/show_exceptions.rb +1 -1
- data/lib/action_dispatch/middleware/ssl.rb +8 -8
- data/lib/action_dispatch/middleware/stack.rb +33 -1
- data/lib/action_dispatch/middleware/static.rb +5 -6
- data/lib/action_dispatch/middleware/templates/rescues/_actions.html.erb +13 -0
- data/lib/action_dispatch/middleware/templates/rescues/_actions.text.erb +0 -0
- data/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb +3 -1
- data/lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb +1 -1
- data/lib/action_dispatch/middleware/templates/rescues/_source.html.erb +4 -2
- data/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb +45 -35
- data/lib/action_dispatch/middleware/templates/rescues/blocked_host.html.erb +7 -0
- data/lib/action_dispatch/middleware/templates/rescues/blocked_host.text.erb +5 -0
- data/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb +26 -4
- data/lib/action_dispatch/middleware/templates/rescues/diagnostics.text.erb +1 -1
- data/lib/action_dispatch/middleware/templates/rescues/invalid_statement.html.erb +7 -4
- data/lib/action_dispatch/middleware/templates/rescues/invalid_statement.text.erb +4 -2
- data/lib/action_dispatch/middleware/templates/rescues/layout.erb +4 -0
- data/lib/action_dispatch/middleware/templates/rescues/missing_exact_template.html.erb +19 -0
- data/lib/action_dispatch/middleware/templates/rescues/missing_exact_template.text.erb +3 -0
- data/lib/action_dispatch/middleware/templates/rescues/missing_template.html.erb +2 -2
- data/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb +1 -1
- data/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb +2 -2
- data/lib/action_dispatch/middleware/templates/routes/_table.html.erb +3 -0
- data/lib/action_dispatch/railtie.rb +7 -2
- data/lib/action_dispatch/request/session.rb +15 -1
- data/lib/action_dispatch/routing.rb +21 -20
- data/lib/action_dispatch/routing/inspector.rb +99 -50
- data/lib/action_dispatch/routing/mapper.rb +61 -39
- data/lib/action_dispatch/routing/polymorphic_routes.rb +3 -4
- data/lib/action_dispatch/routing/route_set.rb +24 -27
- data/lib/action_dispatch/routing/url_for.rb +1 -0
- data/lib/action_dispatch/system_test_case.rb +44 -5
- data/lib/action_dispatch/system_testing/browser.rb +38 -7
- data/lib/action_dispatch/system_testing/driver.rb +10 -1
- data/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb +6 -5
- data/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb +7 -6
- data/lib/action_dispatch/testing/assertions.rb +1 -1
- data/lib/action_dispatch/testing/assertions/response.rb +2 -3
- data/lib/action_dispatch/testing/assertions/routing.rb +15 -3
- data/lib/action_dispatch/testing/integration.rb +12 -5
- data/lib/action_dispatch/testing/request_encoder.rb +2 -2
- data/lib/action_dispatch/testing/test_process.rb +2 -2
- data/lib/action_dispatch/testing/test_response.rb +4 -32
- data/lib/action_pack.rb +1 -1
- data/lib/action_pack/gem_version.rb +4 -4
- metadata +34 -15
- data/lib/action_dispatch/system_testing/test_helpers/undef_methods.rb +0 -26
@@ -29,20 +29,51 @@ module ActionDispatch
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
+
def capabilities
|
33
|
+
@option ||=
|
34
|
+
case type
|
35
|
+
when :chrome
|
36
|
+
::Selenium::WebDriver::Chrome::Options.new
|
37
|
+
when :firefox
|
38
|
+
::Selenium::WebDriver::Firefox::Options.new
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# driver_path can be configured as a proc. The webdrivers gem uses this
|
43
|
+
# proc to update web drivers. Running this proc early allows us to only
|
44
|
+
# update the webdriver once and avoid race conditions when using
|
45
|
+
# parallel tests.
|
46
|
+
def preload
|
47
|
+
case type
|
48
|
+
when :chrome
|
49
|
+
if ::Selenium::WebDriver::Service.respond_to? :driver_path=
|
50
|
+
::Selenium::WebDriver::Chrome::Service.driver_path.try(:call)
|
51
|
+
else
|
52
|
+
# Selenium <= v3.141.0
|
53
|
+
::Selenium::WebDriver::Chrome.driver_path
|
54
|
+
end
|
55
|
+
when :firefox
|
56
|
+
if ::Selenium::WebDriver::Service.respond_to? :driver_path=
|
57
|
+
::Selenium::WebDriver::Firefox::Service.driver_path.try(:call)
|
58
|
+
else
|
59
|
+
# Selenium <= v3.141.0
|
60
|
+
::Selenium::WebDriver::Firefox.driver_path
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
32
65
|
private
|
33
66
|
def headless_chrome_browser_options
|
34
|
-
|
35
|
-
|
36
|
-
options.args << "--disable-gpu" if Gem.win_platform?
|
67
|
+
capabilities.args << "--headless"
|
68
|
+
capabilities.args << "--disable-gpu" if Gem.win_platform?
|
37
69
|
|
38
|
-
|
70
|
+
capabilities
|
39
71
|
end
|
40
72
|
|
41
73
|
def headless_firefox_browser_options
|
42
|
-
|
43
|
-
options.args << "-headless"
|
74
|
+
capabilities.args << "-headless"
|
44
75
|
|
45
|
-
|
76
|
+
capabilities
|
46
77
|
end
|
47
78
|
end
|
48
79
|
end
|
@@ -3,11 +3,14 @@
|
|
3
3
|
module ActionDispatch
|
4
4
|
module SystemTesting
|
5
5
|
class Driver # :nodoc:
|
6
|
-
def initialize(name, **options)
|
6
|
+
def initialize(name, **options, &capabilities)
|
7
7
|
@name = name
|
8
8
|
@browser = Browser.new(options[:using])
|
9
9
|
@screen_size = options[:screen_size]
|
10
10
|
@options = options[:options]
|
11
|
+
@capabilities = capabilities
|
12
|
+
|
13
|
+
@browser.preload
|
11
14
|
end
|
12
15
|
|
13
16
|
def use
|
@@ -22,6 +25,8 @@ module ActionDispatch
|
|
22
25
|
end
|
23
26
|
|
24
27
|
def register
|
28
|
+
define_browser_capabilities(@browser.capabilities)
|
29
|
+
|
25
30
|
Capybara.register_driver @name do |app|
|
26
31
|
case @name
|
27
32
|
when :selenium then register_selenium(app)
|
@@ -31,6 +36,10 @@ module ActionDispatch
|
|
31
36
|
end
|
32
37
|
end
|
33
38
|
|
39
|
+
def define_browser_capabilities(capabilities)
|
40
|
+
@capabilities.call(capabilities) if @capabilities
|
41
|
+
end
|
42
|
+
|
34
43
|
def browser_options
|
35
44
|
@options.merge(options: @browser.options).compact
|
36
45
|
end
|
@@ -20,7 +20,7 @@ module ActionDispatch
|
|
20
20
|
# * [+inline+] Display the screenshot in the terminal using the
|
21
21
|
# iTerm image protocol (https://iterm2.com/documentation-images.html).
|
22
22
|
# * [+artifact+] Display the screenshot in the terminal, using the terminal
|
23
|
-
# artifact format (https://buildkite.github.io/terminal/inline-images/).
|
23
|
+
# artifact format (https://buildkite.github.io/terminal-to-html/inline-images/).
|
24
24
|
def take_screenshot
|
25
25
|
save_image
|
26
26
|
puts display_image
|
@@ -39,11 +39,12 @@ module ActionDispatch
|
|
39
39
|
|
40
40
|
private
|
41
41
|
def image_name
|
42
|
-
|
42
|
+
name = method_name[0...225]
|
43
|
+
failed? ? "failures_#{name}" : name
|
43
44
|
end
|
44
45
|
|
45
46
|
def image_path
|
46
|
-
@image_path ||= absolute_image_path.
|
47
|
+
@image_path ||= absolute_image_path.to_s
|
47
48
|
end
|
48
49
|
|
49
50
|
def absolute_image_path
|
@@ -65,7 +66,7 @@ module ActionDispatch
|
|
65
66
|
end
|
66
67
|
|
67
68
|
def display_image
|
68
|
-
message = "[Screenshot]: #{image_path}\n"
|
69
|
+
message = +"[Screenshot]: #{image_path}\n"
|
69
70
|
|
70
71
|
case output_type
|
71
72
|
when "artifact"
|
@@ -80,7 +81,7 @@ module ActionDispatch
|
|
80
81
|
end
|
81
82
|
|
82
83
|
def inline_base64(path)
|
83
|
-
Base64.
|
84
|
+
Base64.strict_encode64(path)
|
84
85
|
end
|
85
86
|
|
86
87
|
def failed?
|
@@ -7,7 +7,6 @@ module ActionDispatch
|
|
7
7
|
DEFAULT_HOST = "http://127.0.0.1"
|
8
8
|
|
9
9
|
def host!(host)
|
10
|
-
super
|
11
10
|
Capybara.app_host = host
|
12
11
|
end
|
13
12
|
|
@@ -16,12 +15,14 @@ module ActionDispatch
|
|
16
15
|
super
|
17
16
|
end
|
18
17
|
|
18
|
+
def before_teardown
|
19
|
+
take_failed_screenshot
|
20
|
+
ensure
|
21
|
+
super
|
22
|
+
end
|
23
|
+
|
19
24
|
def after_teardown
|
20
|
-
|
21
|
-
take_failed_screenshot
|
22
|
-
ensure
|
23
|
-
Capybara.reset_sessions!
|
24
|
-
end
|
25
|
+
Capybara.reset_sessions!
|
25
26
|
ensure
|
26
27
|
super
|
27
28
|
end
|
@@ -14,7 +14,7 @@ module ActionDispatch
|
|
14
14
|
include Rails::Dom::Testing::Assertions
|
15
15
|
|
16
16
|
def html_document
|
17
|
-
@html_document ||= if @response.
|
17
|
+
@html_document ||= if @response.media_type.to_s.end_with?("xml")
|
18
18
|
Nokogiri::XML::Document.parse(@response.body)
|
19
19
|
else
|
20
20
|
Nokogiri::HTML::Document.parse(@response.body)
|
@@ -79,9 +79,8 @@ module ActionDispatch
|
|
79
79
|
end
|
80
80
|
|
81
81
|
def generate_response_message(expected, actual = @response.response_code)
|
82
|
-
"Expected response to be a <#{code_with_name(expected)}>,"\
|
83
|
-
" but was a <#{code_with_name(actual)}>"
|
84
|
-
.dup.concat(location_if_redirected).concat(response_body_if_short)
|
82
|
+
(+"Expected response to be a <#{code_with_name(expected)}>,"\
|
83
|
+
" but was a <#{code_with_name(actual)}>").concat(location_if_redirected).concat(response_body_if_short)
|
85
84
|
end
|
86
85
|
|
87
86
|
def response_body_if_short
|
@@ -9,6 +9,11 @@ module ActionDispatch
|
|
9
9
|
module Assertions
|
10
10
|
# Suite of assertions to test routes generated by \Rails and the handling of requests made to them.
|
11
11
|
module RoutingAssertions
|
12
|
+
def setup # :nodoc:
|
13
|
+
@routes ||= nil
|
14
|
+
super
|
15
|
+
end
|
16
|
+
|
12
17
|
# Asserts that the routing of the given +path+ was handled correctly and that the parsed options (given in the +expected_options+ hash)
|
13
18
|
# match +path+. Basically, it asserts that \Rails recognizes the route given by +expected_options+.
|
14
19
|
#
|
@@ -78,7 +83,7 @@ module ActionDispatch
|
|
78
83
|
# # Asserts that the generated route gives us our custom route
|
79
84
|
# assert_generates "changesets/12", { controller: 'scm', action: 'show_diff', revision: "12" }
|
80
85
|
def assert_generates(expected_path, options, defaults = {}, extras = {}, message = nil)
|
81
|
-
if
|
86
|
+
if %r{://}.match?(expected_path)
|
82
87
|
fail_on(URI::InvalidURIError, message) do
|
83
88
|
uri = URI.parse(expected_path)
|
84
89
|
expected_path = uri.path.to_s.empty? ? "/" : uri.path
|
@@ -155,9 +160,16 @@ module ActionDispatch
|
|
155
160
|
@controller.singleton_class.include(_routes.url_helpers)
|
156
161
|
|
157
162
|
if @controller.respond_to? :view_context_class
|
158
|
-
|
163
|
+
view_context_class = Class.new(@controller.view_context_class) do
|
159
164
|
include _routes.url_helpers
|
160
165
|
end
|
166
|
+
|
167
|
+
custom_view_context = Module.new {
|
168
|
+
define_method(:view_context_class) do
|
169
|
+
view_context_class
|
170
|
+
end
|
171
|
+
}
|
172
|
+
@controller.extend(custom_view_context)
|
161
173
|
end
|
162
174
|
end
|
163
175
|
yield @routes
|
@@ -189,7 +201,7 @@ module ActionDispatch
|
|
189
201
|
|
190
202
|
request = ActionController::TestRequest.create @controller.class
|
191
203
|
|
192
|
-
if
|
204
|
+
if %r{://}.match?(path)
|
193
205
|
fail_on(URI::InvalidURIError, msg) do
|
194
206
|
uri = URI.parse(path)
|
195
207
|
request.env["rack.url_scheme"] = uri.scheme || "http"
|
@@ -50,10 +50,11 @@ module ActionDispatch
|
|
50
50
|
|
51
51
|
# Follow a single redirect response. If the last response was not a
|
52
52
|
# redirect, an exception will be raised. Otherwise, the redirect is
|
53
|
-
# performed on the location header.
|
54
|
-
|
53
|
+
# performed on the location header. Any arguments are passed to the
|
54
|
+
# underlying call to `get`.
|
55
|
+
def follow_redirect!(**args)
|
55
56
|
raise "not a redirect! #{status} #{status_message}" unless redirect?
|
56
|
-
get(response.location)
|
57
|
+
get(response.location, **args)
|
57
58
|
status
|
58
59
|
end
|
59
60
|
end
|
@@ -189,6 +190,12 @@ module ActionDispatch
|
|
189
190
|
# merged into the Rack env hash.
|
190
191
|
# - +env+: Additional env to pass, as a Hash. The headers will be
|
191
192
|
# merged into the Rack env hash.
|
193
|
+
# - +xhr+: Set to `true` if you want to make and Ajax request.
|
194
|
+
# Adds request headers characteristic of XMLHttpRequest e.g. HTTP_X_REQUESTED_WITH.
|
195
|
+
# The headers will be merged into the Rack env hash.
|
196
|
+
# - +as+: Used for encoding the request with different content type.
|
197
|
+
# Supports `:json` by default and will set the appropriate request headers.
|
198
|
+
# The headers will be merged into the Rack env hash.
|
192
199
|
#
|
193
200
|
# This method is rarely used directly. Use +#get+, +#post+, or other standard
|
194
201
|
# HTTP methods in integration tests. +#process+ is only required when using a
|
@@ -210,7 +217,7 @@ module ActionDispatch
|
|
210
217
|
method = :post
|
211
218
|
end
|
212
219
|
|
213
|
-
if
|
220
|
+
if %r{://}.match?(path)
|
214
221
|
path = build_expanded_path(path) do |location|
|
215
222
|
https! URI::HTTPS === location if location.scheme
|
216
223
|
|
@@ -328,7 +335,7 @@ module ActionDispatch
|
|
328
335
|
klass = APP_SESSIONS[app] ||= Class.new(Integration::Session) {
|
329
336
|
# If the app is a Rails app, make url_helpers available on the session.
|
330
337
|
# This makes app.url_for and app.foo_path available in the console.
|
331
|
-
if app.respond_to?(:routes)
|
338
|
+
if app.respond_to?(:routes) && app.routes.is_a?(ActionDispatch::Routing::RouteSet)
|
332
339
|
include app.routes.url_helpers
|
333
340
|
include app.routes.mounted_helpers
|
334
341
|
end
|
@@ -38,8 +38,8 @@ module ActionDispatch
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def self.parser(content_type)
|
41
|
-
|
42
|
-
encoder(
|
41
|
+
type = Mime::Type.lookup(content_type).ref if content_type
|
42
|
+
encoder(type).response_parser
|
43
43
|
end
|
44
44
|
|
45
45
|
def self.encoder(name)
|
@@ -8,12 +8,12 @@ module ActionDispatch
|
|
8
8
|
module FixtureFile
|
9
9
|
# Shortcut for <tt>Rack::Test::UploadedFile.new(File.join(ActionDispatch::IntegrationTest.fixture_path, path), type)</tt>:
|
10
10
|
#
|
11
|
-
# post :change_avatar, avatar: fixture_file_upload('files/spongebob.png', 'image/png')
|
11
|
+
# post :change_avatar, params: { avatar: fixture_file_upload('files/spongebob.png', 'image/png') }
|
12
12
|
#
|
13
13
|
# To upload binary files on Windows, pass <tt>:binary</tt> as the last parameter.
|
14
14
|
# This will not affect other platforms:
|
15
15
|
#
|
16
|
-
# post :change_avatar, avatar: fixture_file_upload('files/spongebob.png', 'image/png', :binary)
|
16
|
+
# post :change_avatar, params: { avatar: fixture_file_upload('files/spongebob.png', 'image/png', :binary) }
|
17
17
|
def fixture_file_upload(path, mime_type = nil, binary = false)
|
18
18
|
if self.class.respond_to?(:fixture_path) && self.class.fixture_path &&
|
19
19
|
!File.exist?(path)
|
@@ -14,40 +14,12 @@ module ActionDispatch
|
|
14
14
|
new response.status, response.headers, response.body
|
15
15
|
end
|
16
16
|
|
17
|
-
def
|
18
|
-
|
19
|
-
@response_parser = RequestEncoder.parser(content_type)
|
20
|
-
end
|
21
|
-
|
22
|
-
# Was the response successful?
|
23
|
-
def success?
|
24
|
-
ActiveSupport::Deprecation.warn(<<-MSG.squish)
|
25
|
-
The success? predicate is deprecated and will be removed in Rails 6.0.
|
26
|
-
Please use successful? as provided by Rack::Response::Helpers.
|
27
|
-
MSG
|
28
|
-
successful?
|
29
|
-
end
|
30
|
-
|
31
|
-
# Was the URL not found?
|
32
|
-
def missing?
|
33
|
-
ActiveSupport::Deprecation.warn(<<-MSG.squish)
|
34
|
-
The missing? predicate is deprecated and will be removed in Rails 6.0.
|
35
|
-
Please use not_found? as provided by Rack::Response::Helpers.
|
36
|
-
MSG
|
37
|
-
not_found?
|
38
|
-
end
|
39
|
-
|
40
|
-
# Was there a server-side error?
|
41
|
-
def error?
|
42
|
-
ActiveSupport::Deprecation.warn(<<-MSG.squish)
|
43
|
-
The error? predicate is deprecated and will be removed in Rails 6.0.
|
44
|
-
Please use server_error? as provided by Rack::Response::Helpers.
|
45
|
-
MSG
|
46
|
-
server_error?
|
17
|
+
def parsed_body
|
18
|
+
@parsed_body ||= response_parser.call(body)
|
47
19
|
end
|
48
20
|
|
49
|
-
def
|
50
|
-
@
|
21
|
+
def response_parser
|
22
|
+
@response_parser ||= RequestEncoder.parser(media_type)
|
51
23
|
end
|
52
24
|
end
|
53
25
|
end
|
data/lib/action_pack.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
#--
|
4
|
-
# Copyright (c) 2004-
|
4
|
+
# Copyright (c) 2004-2019 David Heinemeier Hansson
|
5
5
|
#
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining
|
7
7
|
# a copy of this software and associated documentation files (the
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionpack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 6.0.2.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 6.0.2.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -31,6 +31,9 @@ dependencies:
|
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '2.0'
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 2.0.8
|
34
37
|
type: :runtime
|
35
38
|
prerelease: false
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -38,6 +41,9 @@ dependencies:
|
|
38
41
|
- - "~>"
|
39
42
|
- !ruby/object:Gem::Version
|
40
43
|
version: '2.0'
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 2.0.8
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: rack-test
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -61,7 +67,7 @@ dependencies:
|
|
61
67
|
version: '1.0'
|
62
68
|
- - ">="
|
63
69
|
- !ruby/object:Gem::Version
|
64
|
-
version: 1.0
|
70
|
+
version: 1.2.0
|
65
71
|
type: :runtime
|
66
72
|
prerelease: false
|
67
73
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -71,7 +77,7 @@ dependencies:
|
|
71
77
|
version: '1.0'
|
72
78
|
- - ">="
|
73
79
|
- !ruby/object:Gem::Version
|
74
|
-
version: 1.0
|
80
|
+
version: 1.2.0
|
75
81
|
- !ruby/object:Gem::Dependency
|
76
82
|
name: rails-dom-testing
|
77
83
|
requirement: !ruby/object:Gem::Requirement
|
@@ -92,28 +98,28 @@ dependencies:
|
|
92
98
|
requirements:
|
93
99
|
- - '='
|
94
100
|
- !ruby/object:Gem::Version
|
95
|
-
version:
|
101
|
+
version: 6.0.2.1
|
96
102
|
type: :runtime
|
97
103
|
prerelease: false
|
98
104
|
version_requirements: !ruby/object:Gem::Requirement
|
99
105
|
requirements:
|
100
106
|
- - '='
|
101
107
|
- !ruby/object:Gem::Version
|
102
|
-
version:
|
108
|
+
version: 6.0.2.1
|
103
109
|
- !ruby/object:Gem::Dependency
|
104
110
|
name: activemodel
|
105
111
|
requirement: !ruby/object:Gem::Requirement
|
106
112
|
requirements:
|
107
113
|
- - '='
|
108
114
|
- !ruby/object:Gem::Version
|
109
|
-
version:
|
115
|
+
version: 6.0.2.1
|
110
116
|
type: :development
|
111
117
|
prerelease: false
|
112
118
|
version_requirements: !ruby/object:Gem::Requirement
|
113
119
|
requirements:
|
114
120
|
- - '='
|
115
121
|
- !ruby/object:Gem::Version
|
116
|
-
version:
|
122
|
+
version: 6.0.2.1
|
117
123
|
description: Web apps on Rails. Simple, battle-tested conventions for building and
|
118
124
|
testing MVC web applications. Works with any Rack-compatible server.
|
119
125
|
email: david@loudthinking.com
|
@@ -151,6 +157,7 @@ files:
|
|
151
157
|
- lib/action_controller/metal/content_security_policy.rb
|
152
158
|
- lib/action_controller/metal/cookies.rb
|
153
159
|
- lib/action_controller/metal/data_streaming.rb
|
160
|
+
- lib/action_controller/metal/default_headers.rb
|
154
161
|
- lib/action_controller/metal/etag_with_flash.rb
|
155
162
|
- lib/action_controller/metal/etag_with_template_digest.rb
|
156
163
|
- lib/action_controller/metal/exceptions.rb
|
@@ -181,6 +188,7 @@ files:
|
|
181
188
|
- lib/action_controller/test_case.rb
|
182
189
|
- lib/action_dispatch.rb
|
183
190
|
- lib/action_dispatch/http/cache.rb
|
191
|
+
- lib/action_dispatch/http/content_disposition.rb
|
184
192
|
- lib/action_dispatch/http/content_security_policy.rb
|
185
193
|
- lib/action_dispatch/http/filter_parameters.rb
|
186
194
|
- lib/action_dispatch/http/filter_redirect.rb
|
@@ -218,13 +226,16 @@ files:
|
|
218
226
|
- lib/action_dispatch/journey/visualizer/fsm.css
|
219
227
|
- lib/action_dispatch/journey/visualizer/fsm.js
|
220
228
|
- lib/action_dispatch/journey/visualizer/index.html.erb
|
229
|
+
- lib/action_dispatch/middleware/actionable_exceptions.rb
|
221
230
|
- lib/action_dispatch/middleware/callbacks.rb
|
222
231
|
- lib/action_dispatch/middleware/cookies.rb
|
223
232
|
- lib/action_dispatch/middleware/debug_exceptions.rb
|
224
233
|
- lib/action_dispatch/middleware/debug_locks.rb
|
234
|
+
- lib/action_dispatch/middleware/debug_view.rb
|
225
235
|
- lib/action_dispatch/middleware/exception_wrapper.rb
|
226
236
|
- lib/action_dispatch/middleware/executor.rb
|
227
237
|
- lib/action_dispatch/middleware/flash.rb
|
238
|
+
- lib/action_dispatch/middleware/host_authorization.rb
|
228
239
|
- lib/action_dispatch/middleware/public_exceptions.rb
|
229
240
|
- lib/action_dispatch/middleware/reloader.rb
|
230
241
|
- lib/action_dispatch/middleware/remote_ip.rb
|
@@ -237,17 +248,23 @@ files:
|
|
237
248
|
- lib/action_dispatch/middleware/ssl.rb
|
238
249
|
- lib/action_dispatch/middleware/stack.rb
|
239
250
|
- lib/action_dispatch/middleware/static.rb
|
251
|
+
- lib/action_dispatch/middleware/templates/rescues/_actions.html.erb
|
252
|
+
- lib/action_dispatch/middleware/templates/rescues/_actions.text.erb
|
240
253
|
- lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb
|
241
254
|
- lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb
|
242
255
|
- lib/action_dispatch/middleware/templates/rescues/_source.html.erb
|
243
256
|
- lib/action_dispatch/middleware/templates/rescues/_source.text.erb
|
244
257
|
- lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
|
245
258
|
- lib/action_dispatch/middleware/templates/rescues/_trace.text.erb
|
259
|
+
- lib/action_dispatch/middleware/templates/rescues/blocked_host.html.erb
|
260
|
+
- lib/action_dispatch/middleware/templates/rescues/blocked_host.text.erb
|
246
261
|
- lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb
|
247
262
|
- lib/action_dispatch/middleware/templates/rescues/diagnostics.text.erb
|
248
263
|
- lib/action_dispatch/middleware/templates/rescues/invalid_statement.html.erb
|
249
264
|
- lib/action_dispatch/middleware/templates/rescues/invalid_statement.text.erb
|
250
265
|
- lib/action_dispatch/middleware/templates/rescues/layout.erb
|
266
|
+
- lib/action_dispatch/middleware/templates/rescues/missing_exact_template.html.erb
|
267
|
+
- lib/action_dispatch/middleware/templates/rescues/missing_exact_template.text.erb
|
251
268
|
- lib/action_dispatch/middleware/templates/rescues/missing_template.html.erb
|
252
269
|
- lib/action_dispatch/middleware/templates/rescues/missing_template.text.erb
|
253
270
|
- lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb
|
@@ -276,7 +293,6 @@ files:
|
|
276
293
|
- lib/action_dispatch/system_testing/server.rb
|
277
294
|
- lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb
|
278
295
|
- lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb
|
279
|
-
- lib/action_dispatch/system_testing/test_helpers/undef_methods.rb
|
280
296
|
- lib/action_dispatch/testing/assertion_response.rb
|
281
297
|
- lib/action_dispatch/testing/assertions.rb
|
282
298
|
- lib/action_dispatch/testing/assertions/response.rb
|
@@ -289,12 +305,15 @@ files:
|
|
289
305
|
- lib/action_pack.rb
|
290
306
|
- lib/action_pack/gem_version.rb
|
291
307
|
- lib/action_pack/version.rb
|
292
|
-
homepage:
|
308
|
+
homepage: https://rubyonrails.org
|
293
309
|
licenses:
|
294
310
|
- MIT
|
295
311
|
metadata:
|
296
|
-
|
297
|
-
changelog_uri: https://github.com/rails/rails/blob/
|
312
|
+
bug_tracker_uri: https://github.com/rails/rails/issues
|
313
|
+
changelog_uri: https://github.com/rails/rails/blob/v6.0.2.1/actionpack/CHANGELOG.md
|
314
|
+
documentation_uri: https://api.rubyonrails.org/v6.0.2.1/
|
315
|
+
mailing_list_uri: https://groups.google.com/forum/#!forum/rubyonrails-talk
|
316
|
+
source_code_uri: https://github.com/rails/rails/tree/v6.0.2.1/actionpack
|
298
317
|
post_install_message:
|
299
318
|
rdoc_options: []
|
300
319
|
require_paths:
|
@@ -303,7 +322,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
303
322
|
requirements:
|
304
323
|
- - ">="
|
305
324
|
- !ruby/object:Gem::Version
|
306
|
-
version: 2.
|
325
|
+
version: 2.5.0
|
307
326
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
308
327
|
requirements:
|
309
328
|
- - ">="
|