actionpack 6.1.4 → 7.0.0.rc1
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 +189 -372
- data/MIT-LICENSE +1 -1
- data/README.rdoc +2 -3
- data/lib/abstract_controller/asset_paths.rb +1 -1
- data/lib/abstract_controller/base.rb +7 -21
- data/lib/abstract_controller/caching/fragments.rb +2 -2
- data/lib/abstract_controller/caching.rb +1 -1
- data/lib/abstract_controller/callbacks.rb +21 -7
- data/lib/abstract_controller/collector.rb +4 -2
- data/lib/abstract_controller/error.rb +1 -1
- data/lib/abstract_controller/helpers.rb +3 -2
- data/lib/abstract_controller/logger.rb +1 -1
- data/lib/abstract_controller/railties/routes_helpers.rb +2 -0
- data/lib/abstract_controller/translation.rb +3 -2
- data/lib/abstract_controller/url_for.rb +4 -6
- data/lib/action_controller/api.rb +1 -1
- data/lib/action_controller/log_subscriber.rb +4 -3
- data/lib/action_controller/metal/conditional_get.rb +38 -1
- data/lib/action_controller/metal/content_security_policy.rb +1 -1
- data/lib/action_controller/metal/cookies.rb +1 -1
- data/lib/action_controller/metal/data_streaming.rb +5 -13
- data/lib/action_controller/metal/exceptions.rb +19 -30
- data/lib/action_controller/metal/flash.rb +6 -2
- data/lib/action_controller/metal/helpers.rb +1 -1
- data/lib/action_controller/metal/http_authentication.rb +17 -16
- data/lib/action_controller/metal/instrumentation.rb +57 -52
- data/lib/action_controller/metal/live.rb +42 -2
- data/lib/action_controller/metal/mime_responds.rb +3 -3
- data/lib/action_controller/metal/params_wrapper.rb +20 -11
- data/lib/action_controller/metal/permissions_policy.rb +1 -1
- data/lib/action_controller/metal/redirecting.rb +86 -16
- data/lib/action_controller/metal/rendering.rb +7 -7
- data/lib/action_controller/metal/request_forgery_protection.rb +64 -24
- data/lib/action_controller/metal/rescue.rb +1 -1
- data/lib/action_controller/metal/streaming.rb +1 -3
- data/lib/action_controller/metal/strong_parameters.rb +84 -47
- data/lib/action_controller/metal/testing.rb +0 -2
- data/lib/action_controller/metal.rb +7 -10
- data/lib/action_controller/railtie.rb +49 -6
- data/lib/action_controller/test_case.rb +19 -4
- data/lib/action_controller.rb +1 -5
- data/lib/action_dispatch/http/cache.rb +13 -6
- data/lib/action_dispatch/http/content_security_policy.rb +39 -35
- data/lib/action_dispatch/http/filter_parameters.rb +5 -0
- data/lib/action_dispatch/http/mime_negotiation.rb +13 -3
- data/lib/action_dispatch/http/mime_type.rb +9 -11
- data/lib/action_dispatch/http/parameters.rb +4 -4
- data/lib/action_dispatch/http/permissions_policy.rb +1 -1
- data/lib/action_dispatch/http/request.rb +10 -19
- data/lib/action_dispatch/http/response.rb +1 -13
- data/lib/action_dispatch/http/url.rb +11 -19
- data/lib/action_dispatch/journey/gtg/builder.rb +11 -12
- data/lib/action_dispatch/journey/gtg/simulator.rb +10 -4
- data/lib/action_dispatch/journey/gtg/transition_table.rb +77 -21
- data/lib/action_dispatch/journey/nodes/node.rb +70 -5
- data/lib/action_dispatch/journey/path/pattern.rb +22 -13
- data/lib/action_dispatch/journey/route.rb +6 -13
- data/lib/action_dispatch/journey/router/utils.rb +2 -2
- data/lib/action_dispatch/journey/router.rb +1 -1
- data/lib/action_dispatch/journey/routes.rb +3 -3
- data/lib/action_dispatch/journey/visualizer/fsm.js +49 -24
- data/lib/action_dispatch/journey/visualizer/index.html.erb +1 -1
- data/lib/action_dispatch/middleware/actionable_exceptions.rb +0 -1
- data/lib/action_dispatch/middleware/cookies.rb +8 -4
- data/lib/action_dispatch/middleware/debug_exceptions.rb +6 -4
- data/lib/action_dispatch/middleware/debug_locks.rb +3 -3
- data/lib/action_dispatch/middleware/exception_wrapper.rb +4 -0
- data/lib/action_dispatch/middleware/executor.rb +3 -0
- data/lib/action_dispatch/middleware/flash.rb +9 -11
- data/lib/action_dispatch/middleware/host_authorization.rb +49 -37
- data/lib/action_dispatch/middleware/remote_ip.rb +16 -4
- data/lib/action_dispatch/middleware/server_timing.rb +33 -0
- data/lib/action_dispatch/middleware/session/abstract_store.rb +1 -1
- data/lib/action_dispatch/middleware/show_exceptions.rb +17 -9
- data/lib/action_dispatch/middleware/stack.rb +27 -9
- data/lib/action_dispatch/middleware/static.rb +2 -6
- data/lib/action_dispatch/middleware/templates/rescues/_message_and_suggestions.html.erb +1 -1
- data/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb +4 -11
- data/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb +2 -2
- data/lib/action_dispatch/middleware/templates/rescues/blocked_host.html.erb +4 -3
- data/lib/action_dispatch/middleware/templates/rescues/blocked_host.text.erb +3 -1
- data/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb +4 -4
- data/lib/action_dispatch/middleware/templates/rescues/invalid_statement.html.erb +3 -3
- data/lib/action_dispatch/middleware/templates/rescues/layout.erb +28 -18
- data/lib/action_dispatch/middleware/templates/rescues/missing_exact_template.html.erb +3 -3
- data/lib/action_dispatch/middleware/templates/rescues/missing_template.html.erb +3 -3
- data/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb +3 -3
- data/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb +3 -3
- data/lib/action_dispatch/middleware/templates/rescues/unknown_action.html.erb +3 -3
- data/lib/action_dispatch/middleware/templates/routes/_table.html.erb +5 -14
- data/lib/action_dispatch/railtie.rb +8 -2
- data/lib/action_dispatch/request/session.rb +43 -13
- data/lib/action_dispatch/routing/inspector.rb +1 -1
- data/lib/action_dispatch/routing/mapper.rb +54 -78
- data/lib/action_dispatch/routing/redirection.rb +0 -2
- data/lib/action_dispatch/routing/route_set.rb +14 -6
- data/lib/action_dispatch/routing/routes_proxy.rb +1 -1
- data/lib/action_dispatch/routing/url_for.rb +1 -2
- data/lib/action_dispatch/routing.rb +2 -2
- data/lib/action_dispatch/system_test_case.rb +12 -6
- data/lib/action_dispatch/system_testing/browser.rb +2 -12
- data/lib/action_dispatch/system_testing/driver.rb +35 -11
- data/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb +10 -6
- data/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb +0 -8
- data/lib/action_dispatch/testing/assertions.rb +2 -5
- data/lib/action_dispatch/testing/integration.rb +6 -8
- data/lib/action_dispatch/testing/test_process.rb +3 -26
- data/lib/action_dispatch.rb +2 -1
- data/lib/action_pack/gem_version.rb +4 -4
- data/lib/action_pack.rb +1 -1
- metadata +19 -17
@@ -8,7 +8,7 @@ require "minitest"
|
|
8
8
|
require "action_dispatch/testing/request_encoder"
|
9
9
|
|
10
10
|
module ActionDispatch
|
11
|
-
module Integration
|
11
|
+
module Integration # :nodoc:
|
12
12
|
module RequestHelpers
|
13
13
|
# Performs a GET request with the given parameters. See ActionDispatch::Integration::Session#process
|
14
14
|
# for more details.
|
@@ -199,7 +199,7 @@ module ActionDispatch
|
|
199
199
|
# merged into the Rack env hash.
|
200
200
|
# - +env+: Additional env to pass, as a Hash. The headers will be
|
201
201
|
# merged into the Rack env hash.
|
202
|
-
# - +xhr+: Set to +true+ if you want to make
|
202
|
+
# - +xhr+: Set to +true+ if you want to make an Ajax request.
|
203
203
|
# Adds request headers characteristic of XMLHttpRequest e.g. HTTP_X_REQUESTED_WITH.
|
204
204
|
# The headers will be merged into the Rack env hash.
|
205
205
|
# - +as+: Used for encoding the request with different content type.
|
@@ -363,13 +363,11 @@ module ActionDispatch
|
|
363
363
|
reset_html_document = "@html_document = nil"
|
364
364
|
end
|
365
365
|
|
366
|
-
definition = RUBY_VERSION >= "2.7" ? "..." : "*args"
|
367
|
-
|
368
366
|
module_eval <<~RUBY, __FILE__, __LINE__ + 1
|
369
|
-
def #{method}(
|
367
|
+
def #{method}(...)
|
370
368
|
#{reset_html_document}
|
371
369
|
|
372
|
-
result = integration_session.#{method}(
|
370
|
+
result = integration_session.#{method}(...)
|
373
371
|
copy_session_variables!
|
374
372
|
result
|
375
373
|
end
|
@@ -404,7 +402,7 @@ module ActionDispatch
|
|
404
402
|
|
405
403
|
# Copy the instance variables from the current session instance into the
|
406
404
|
# test instance.
|
407
|
-
def copy_session_variables!
|
405
|
+
def copy_session_variables! # :nodoc:
|
408
406
|
@controller = @integration_session.controller
|
409
407
|
@response = @integration_session.response
|
410
408
|
@request = @integration_session.request
|
@@ -433,7 +431,7 @@ module ActionDispatch
|
|
433
431
|
super
|
434
432
|
end
|
435
433
|
end
|
436
|
-
ruby2_keywords(:method_missing)
|
434
|
+
ruby2_keywords(:method_missing)
|
437
435
|
end
|
438
436
|
end
|
439
437
|
|
@@ -8,39 +8,16 @@ module ActionDispatch
|
|
8
8
|
module FixtureFile
|
9
9
|
# Shortcut for <tt>Rack::Test::UploadedFile.new(File.join(ActionDispatch::IntegrationTest.file_fixture_path, path), type)</tt>:
|
10
10
|
#
|
11
|
-
# post :change_avatar, params: { avatar: fixture_file_upload('
|
11
|
+
# post :change_avatar, params: { avatar: fixture_file_upload('david.png', 'image/png') }
|
12
12
|
#
|
13
13
|
# Default fixture files location is <tt>test/fixtures/files</tt>.
|
14
14
|
#
|
15
15
|
# To upload binary files on Windows, pass <tt>:binary</tt> as the last parameter.
|
16
16
|
# This will not affect other platforms:
|
17
17
|
#
|
18
|
-
# post :change_avatar, params: { avatar: fixture_file_upload('
|
18
|
+
# post :change_avatar, params: { avatar: fixture_file_upload('david.png', 'image/png', :binary) }
|
19
19
|
def fixture_file_upload(path, mime_type = nil, binary = false)
|
20
|
-
if self.class.
|
21
|
-
!File.exist?(path)
|
22
|
-
original_path = path
|
23
|
-
path = Pathname.new(self.class.fixture_path).join(path)
|
24
|
-
|
25
|
-
if !self.class.file_fixture_path
|
26
|
-
ActiveSupport::Deprecation.warn(<<~EOM)
|
27
|
-
Passing a path to `fixture_file_upload` relative to `fixture_path` is deprecated.
|
28
|
-
In Rails 6.2, the path needs to be relative to `file_fixture_path` which you
|
29
|
-
haven't set yet. Set `file_fixture_path` to discard this warning.
|
30
|
-
EOM
|
31
|
-
elsif path.exist?
|
32
|
-
non_deprecated_path = Pathname(File.absolute_path(path)).relative_path_from(Pathname(File.absolute_path(self.class.file_fixture_path)))
|
33
|
-
ActiveSupport::Deprecation.warn(<<~EOM)
|
34
|
-
Passing a path to `fixture_file_upload` relative to `fixture_path` is deprecated.
|
35
|
-
In Rails 6.2, the path needs to be relative to `file_fixture_path`.
|
36
|
-
|
37
|
-
Please modify the call from
|
38
|
-
`fixture_file_upload("#{original_path}")` to `fixture_file_upload("#{non_deprecated_path}")`.
|
39
|
-
EOM
|
40
|
-
else
|
41
|
-
path = file_fixture(original_path)
|
42
|
-
end
|
43
|
-
elsif self.class.file_fixture_path && !File.exist?(path)
|
20
|
+
if self.class.file_fixture_path && !File.exist?(path)
|
44
21
|
path = file_fixture(path)
|
45
22
|
end
|
46
23
|
|
data/lib/action_dispatch.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
#--
|
4
|
-
# Copyright (c) 2004-
|
4
|
+
# Copyright (c) 2004-2021 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
|
@@ -67,6 +67,7 @@ module ActionDispatch
|
|
67
67
|
autoload :PublicExceptions
|
68
68
|
autoload :Reloader
|
69
69
|
autoload :RemoteIp
|
70
|
+
autoload :ServerTiming
|
70
71
|
autoload :ShowExceptions
|
71
72
|
autoload :SSL
|
72
73
|
autoload :Static
|
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-2021 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: 7.0.0.rc1
|
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: 2021-06
|
11
|
+
date: 2021-12-06 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: 7.0.0.rc1
|
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: 7.0.0.rc1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
version: '2.0'
|
34
34
|
- - ">="
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: 2.0
|
36
|
+
version: 2.2.0
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '2.0'
|
44
44
|
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 2.0
|
46
|
+
version: 2.2.0
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rack-test
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,28 +98,28 @@ dependencies:
|
|
98
98
|
requirements:
|
99
99
|
- - '='
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version:
|
101
|
+
version: 7.0.0.rc1
|
102
102
|
type: :runtime
|
103
103
|
prerelease: false
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
105
|
requirements:
|
106
106
|
- - '='
|
107
107
|
- !ruby/object:Gem::Version
|
108
|
-
version:
|
108
|
+
version: 7.0.0.rc1
|
109
109
|
- !ruby/object:Gem::Dependency
|
110
110
|
name: activemodel
|
111
111
|
requirement: !ruby/object:Gem::Requirement
|
112
112
|
requirements:
|
113
113
|
- - '='
|
114
114
|
- !ruby/object:Gem::Version
|
115
|
-
version:
|
115
|
+
version: 7.0.0.rc1
|
116
116
|
type: :development
|
117
117
|
prerelease: false
|
118
118
|
version_requirements: !ruby/object:Gem::Requirement
|
119
119
|
requirements:
|
120
120
|
- - '='
|
121
121
|
- !ruby/object:Gem::Version
|
122
|
-
version:
|
122
|
+
version: 7.0.0.rc1
|
123
123
|
description: Web apps on Rails. Simple, battle-tested conventions for building and
|
124
124
|
testing MVC web applications. Works with any Rack-compatible server.
|
125
125
|
email: david@loudthinking.com
|
@@ -238,6 +238,7 @@ files:
|
|
238
238
|
- lib/action_dispatch/middleware/reloader.rb
|
239
239
|
- lib/action_dispatch/middleware/remote_ip.rb
|
240
240
|
- lib/action_dispatch/middleware/request_id.rb
|
241
|
+
- lib/action_dispatch/middleware/server_timing.rb
|
241
242
|
- lib/action_dispatch/middleware/session/abstract_store.rb
|
242
243
|
- lib/action_dispatch/middleware/session/cache_store.rb
|
243
244
|
- lib/action_dispatch/middleware/session/cookie_store.rb
|
@@ -309,10 +310,11 @@ licenses:
|
|
309
310
|
- MIT
|
310
311
|
metadata:
|
311
312
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
312
|
-
changelog_uri: https://github.com/rails/rails/blob/
|
313
|
-
documentation_uri: https://api.rubyonrails.org/
|
313
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.0.0.rc1/actionpack/CHANGELOG.md
|
314
|
+
documentation_uri: https://api.rubyonrails.org/v7.0.0.rc1/
|
314
315
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
315
|
-
source_code_uri: https://github.com/rails/rails/tree/
|
316
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.0.0.rc1/actionpack
|
317
|
+
rubygems_mfa_required: 'true'
|
316
318
|
post_install_message:
|
317
319
|
rdoc_options: []
|
318
320
|
require_paths:
|
@@ -321,15 +323,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
321
323
|
requirements:
|
322
324
|
- - ">="
|
323
325
|
- !ruby/object:Gem::Version
|
324
|
-
version: 2.
|
326
|
+
version: 2.7.0
|
325
327
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
326
328
|
requirements:
|
327
|
-
- - "
|
329
|
+
- - ">"
|
328
330
|
- !ruby/object:Gem::Version
|
329
|
-
version:
|
331
|
+
version: 1.3.1
|
330
332
|
requirements:
|
331
333
|
- none
|
332
|
-
rubygems_version: 3.
|
334
|
+
rubygems_version: 3.2.22
|
333
335
|
signing_key:
|
334
336
|
specification_version: 4
|
335
337
|
summary: Web-flow and rendering framework putting the VC in MVC (part of Rails).
|