actionpack 5.2.4.1 → 6.0.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 +191 -335
- 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 +8 -7
- 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 +0 -14
- data/lib/action_dispatch/middleware/session/cache_store.rb +6 -11
- data/lib/action_dispatch/middleware/session/cookie_store.rb +8 -23
- 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 +8 -6
- 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 +43 -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 +28 -21
- 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.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-11-05 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.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.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -31,9 +31,6 @@ 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
|
37
34
|
type: :runtime
|
38
35
|
prerelease: false
|
39
36
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -41,9 +38,6 @@ dependencies:
|
|
41
38
|
- - "~>"
|
42
39
|
- !ruby/object:Gem::Version
|
43
40
|
version: '2.0'
|
44
|
-
- - ">="
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: 2.0.8
|
47
41
|
- !ruby/object:Gem::Dependency
|
48
42
|
name: rack-test
|
49
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,7 +61,7 @@ dependencies:
|
|
67
61
|
version: '1.0'
|
68
62
|
- - ">="
|
69
63
|
- !ruby/object:Gem::Version
|
70
|
-
version: 1.0
|
64
|
+
version: 1.2.0
|
71
65
|
type: :runtime
|
72
66
|
prerelease: false
|
73
67
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -77,7 +71,7 @@ dependencies:
|
|
77
71
|
version: '1.0'
|
78
72
|
- - ">="
|
79
73
|
- !ruby/object:Gem::Version
|
80
|
-
version: 1.0
|
74
|
+
version: 1.2.0
|
81
75
|
- !ruby/object:Gem::Dependency
|
82
76
|
name: rails-dom-testing
|
83
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,28 +92,28 @@ dependencies:
|
|
98
92
|
requirements:
|
99
93
|
- - '='
|
100
94
|
- !ruby/object:Gem::Version
|
101
|
-
version:
|
95
|
+
version: 6.0.1
|
102
96
|
type: :runtime
|
103
97
|
prerelease: false
|
104
98
|
version_requirements: !ruby/object:Gem::Requirement
|
105
99
|
requirements:
|
106
100
|
- - '='
|
107
101
|
- !ruby/object:Gem::Version
|
108
|
-
version:
|
102
|
+
version: 6.0.1
|
109
103
|
- !ruby/object:Gem::Dependency
|
110
104
|
name: activemodel
|
111
105
|
requirement: !ruby/object:Gem::Requirement
|
112
106
|
requirements:
|
113
107
|
- - '='
|
114
108
|
- !ruby/object:Gem::Version
|
115
|
-
version:
|
109
|
+
version: 6.0.1
|
116
110
|
type: :development
|
117
111
|
prerelease: false
|
118
112
|
version_requirements: !ruby/object:Gem::Requirement
|
119
113
|
requirements:
|
120
114
|
- - '='
|
121
115
|
- !ruby/object:Gem::Version
|
122
|
-
version:
|
116
|
+
version: 6.0.1
|
123
117
|
description: Web apps on Rails. Simple, battle-tested conventions for building and
|
124
118
|
testing MVC web applications. Works with any Rack-compatible server.
|
125
119
|
email: david@loudthinking.com
|
@@ -157,6 +151,7 @@ files:
|
|
157
151
|
- lib/action_controller/metal/content_security_policy.rb
|
158
152
|
- lib/action_controller/metal/cookies.rb
|
159
153
|
- lib/action_controller/metal/data_streaming.rb
|
154
|
+
- lib/action_controller/metal/default_headers.rb
|
160
155
|
- lib/action_controller/metal/etag_with_flash.rb
|
161
156
|
- lib/action_controller/metal/etag_with_template_digest.rb
|
162
157
|
- lib/action_controller/metal/exceptions.rb
|
@@ -187,6 +182,7 @@ files:
|
|
187
182
|
- lib/action_controller/test_case.rb
|
188
183
|
- lib/action_dispatch.rb
|
189
184
|
- lib/action_dispatch/http/cache.rb
|
185
|
+
- lib/action_dispatch/http/content_disposition.rb
|
190
186
|
- lib/action_dispatch/http/content_security_policy.rb
|
191
187
|
- lib/action_dispatch/http/filter_parameters.rb
|
192
188
|
- lib/action_dispatch/http/filter_redirect.rb
|
@@ -224,13 +220,16 @@ files:
|
|
224
220
|
- lib/action_dispatch/journey/visualizer/fsm.css
|
225
221
|
- lib/action_dispatch/journey/visualizer/fsm.js
|
226
222
|
- lib/action_dispatch/journey/visualizer/index.html.erb
|
223
|
+
- lib/action_dispatch/middleware/actionable_exceptions.rb
|
227
224
|
- lib/action_dispatch/middleware/callbacks.rb
|
228
225
|
- lib/action_dispatch/middleware/cookies.rb
|
229
226
|
- lib/action_dispatch/middleware/debug_exceptions.rb
|
230
227
|
- lib/action_dispatch/middleware/debug_locks.rb
|
228
|
+
- lib/action_dispatch/middleware/debug_view.rb
|
231
229
|
- lib/action_dispatch/middleware/exception_wrapper.rb
|
232
230
|
- lib/action_dispatch/middleware/executor.rb
|
233
231
|
- lib/action_dispatch/middleware/flash.rb
|
232
|
+
- lib/action_dispatch/middleware/host_authorization.rb
|
234
233
|
- lib/action_dispatch/middleware/public_exceptions.rb
|
235
234
|
- lib/action_dispatch/middleware/reloader.rb
|
236
235
|
- lib/action_dispatch/middleware/remote_ip.rb
|
@@ -243,17 +242,23 @@ files:
|
|
243
242
|
- lib/action_dispatch/middleware/ssl.rb
|
244
243
|
- lib/action_dispatch/middleware/stack.rb
|
245
244
|
- lib/action_dispatch/middleware/static.rb
|
245
|
+
- lib/action_dispatch/middleware/templates/rescues/_actions.html.erb
|
246
|
+
- lib/action_dispatch/middleware/templates/rescues/_actions.text.erb
|
246
247
|
- lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb
|
247
248
|
- lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb
|
248
249
|
- lib/action_dispatch/middleware/templates/rescues/_source.html.erb
|
249
250
|
- lib/action_dispatch/middleware/templates/rescues/_source.text.erb
|
250
251
|
- lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
|
251
252
|
- lib/action_dispatch/middleware/templates/rescues/_trace.text.erb
|
253
|
+
- lib/action_dispatch/middleware/templates/rescues/blocked_host.html.erb
|
254
|
+
- lib/action_dispatch/middleware/templates/rescues/blocked_host.text.erb
|
252
255
|
- lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb
|
253
256
|
- lib/action_dispatch/middleware/templates/rescues/diagnostics.text.erb
|
254
257
|
- lib/action_dispatch/middleware/templates/rescues/invalid_statement.html.erb
|
255
258
|
- lib/action_dispatch/middleware/templates/rescues/invalid_statement.text.erb
|
256
259
|
- lib/action_dispatch/middleware/templates/rescues/layout.erb
|
260
|
+
- lib/action_dispatch/middleware/templates/rescues/missing_exact_template.html.erb
|
261
|
+
- lib/action_dispatch/middleware/templates/rescues/missing_exact_template.text.erb
|
257
262
|
- lib/action_dispatch/middleware/templates/rescues/missing_template.html.erb
|
258
263
|
- lib/action_dispatch/middleware/templates/rescues/missing_template.text.erb
|
259
264
|
- lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb
|
@@ -282,7 +287,6 @@ files:
|
|
282
287
|
- lib/action_dispatch/system_testing/server.rb
|
283
288
|
- lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb
|
284
289
|
- lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb
|
285
|
-
- lib/action_dispatch/system_testing/test_helpers/undef_methods.rb
|
286
290
|
- lib/action_dispatch/testing/assertion_response.rb
|
287
291
|
- lib/action_dispatch/testing/assertions.rb
|
288
292
|
- lib/action_dispatch/testing/assertions/response.rb
|
@@ -295,12 +299,15 @@ files:
|
|
295
299
|
- lib/action_pack.rb
|
296
300
|
- lib/action_pack/gem_version.rb
|
297
301
|
- lib/action_pack/version.rb
|
298
|
-
homepage:
|
302
|
+
homepage: https://rubyonrails.org
|
299
303
|
licenses:
|
300
304
|
- MIT
|
301
305
|
metadata:
|
302
|
-
|
303
|
-
changelog_uri: https://github.com/rails/rails/blob/
|
306
|
+
bug_tracker_uri: https://github.com/rails/rails/issues
|
307
|
+
changelog_uri: https://github.com/rails/rails/blob/v6.0.1/actionpack/CHANGELOG.md
|
308
|
+
documentation_uri: https://api.rubyonrails.org/v6.0.1/
|
309
|
+
mailing_list_uri: https://groups.google.com/forum/#!forum/rubyonrails-talk
|
310
|
+
source_code_uri: https://github.com/rails/rails/tree/v6.0.1/actionpack
|
304
311
|
post_install_message:
|
305
312
|
rdoc_options: []
|
306
313
|
require_paths:
|
@@ -309,7 +316,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
309
316
|
requirements:
|
310
317
|
- - ">="
|
311
318
|
- !ruby/object:Gem::Version
|
312
|
-
version: 2.
|
319
|
+
version: 2.5.0
|
313
320
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
314
321
|
requirements:
|
315
322
|
- - ">="
|