actionpack 6.0.2.2 → 6.0.3.3
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 +36 -0
- data/README.rdoc +1 -1
- data/lib/abstract_controller/base.rb +0 -1
- data/lib/abstract_controller/caching.rb +1 -1
- data/lib/abstract_controller/collector.rb +0 -1
- data/lib/abstract_controller/helpers.rb +5 -4
- data/lib/abstract_controller/translation.rb +4 -5
- data/lib/action_controller/caching.rb +0 -1
- data/lib/action_controller/metal.rb +7 -5
- data/lib/action_controller/metal/content_security_policy.rb +0 -1
- data/lib/action_controller/metal/instrumentation.rb +0 -1
- data/lib/action_controller/metal/live.rb +0 -4
- data/lib/action_controller/metal/params_wrapper.rb +0 -1
- data/lib/action_controller/metal/rendering.rb +0 -1
- data/lib/action_controller/metal/request_forgery_protection.rb +27 -9
- data/lib/action_controller/metal/streaming.rb +0 -1
- data/lib/action_controller/metal/strong_parameters.rb +4 -0
- data/lib/action_controller/test_case.rb +7 -5
- data/lib/action_dispatch.rb +3 -0
- data/lib/action_dispatch/http/cache.rb +0 -1
- data/lib/action_dispatch/http/content_security_policy.rb +0 -2
- data/lib/action_dispatch/http/filter_parameters.rb +0 -1
- data/lib/action_dispatch/http/filter_redirect.rb +0 -1
- data/lib/action_dispatch/http/headers.rb +0 -1
- data/lib/action_dispatch/http/mime_negotiation.rb +0 -1
- data/lib/action_dispatch/http/mime_type.rb +1 -3
- data/lib/action_dispatch/http/parameters.rb +1 -2
- data/lib/action_dispatch/http/request.rb +9 -1
- data/lib/action_dispatch/http/response.rb +0 -1
- data/lib/action_dispatch/http/url.rb +0 -1
- data/lib/action_dispatch/journey/formatter.rb +0 -1
- data/lib/action_dispatch/journey/gtg/builder.rb +0 -1
- data/lib/action_dispatch/journey/gtg/transition_table.rb +0 -1
- data/lib/action_dispatch/journey/nfa/transition_table.rb +0 -1
- data/lib/action_dispatch/journey/path/pattern.rb +0 -1
- data/lib/action_dispatch/journey/router.rb +0 -1
- data/lib/action_dispatch/journey/routes.rb +0 -1
- data/lib/action_dispatch/journey/scanner.rb +0 -1
- data/lib/action_dispatch/journey/visitors.rb +0 -3
- data/lib/action_dispatch/middleware/actionable_exceptions.rb +1 -1
- data/lib/action_dispatch/middleware/cookies.rb +6 -6
- data/lib/action_dispatch/middleware/debug_exceptions.rb +7 -3
- data/lib/action_dispatch/middleware/debug_view.rb +3 -5
- data/lib/action_dispatch/middleware/exception_wrapper.rb +0 -1
- data/lib/action_dispatch/middleware/host_authorization.rb +0 -2
- data/lib/action_dispatch/middleware/public_exceptions.rb +0 -1
- data/lib/action_dispatch/middleware/remote_ip.rb +0 -1
- data/lib/action_dispatch/middleware/session/abstract_store.rb +0 -1
- data/lib/action_dispatch/middleware/session/cookie_store.rb +0 -1
- data/lib/action_dispatch/middleware/show_exceptions.rb +0 -1
- data/lib/action_dispatch/middleware/stack.rb +5 -1
- data/lib/action_dispatch/middleware/static.rb +1 -1
- data/lib/action_dispatch/request/session.rb +0 -1
- data/lib/action_dispatch/routing/inspector.rb +0 -2
- data/lib/action_dispatch/routing/mapper.rb +2 -3
- data/lib/action_dispatch/routing/polymorphic_routes.rb +0 -2
- data/lib/action_dispatch/routing/route_set.rb +1 -4
- data/lib/action_dispatch/routing/url_for.rb +0 -2
- data/lib/action_dispatch/system_test_case.rb +2 -3
- data/lib/action_dispatch/system_testing/driver.rb +2 -2
- data/lib/action_dispatch/testing/assertion_response.rb +0 -1
- data/lib/action_dispatch/testing/integration.rb +22 -7
- data/lib/action_pack/gem_version.rb +2 -2
- metadata +13 -13
@@ -362,7 +362,7 @@ module ActionDispatch
|
|
362
362
|
|
363
363
|
def translate_controller(controller)
|
364
364
|
return controller if Regexp === controller
|
365
|
-
return controller.to_s if
|
365
|
+
return controller.to_s if /\A[a-z_0-9][a-z_0-9\/]*\z/.match?(controller)
|
366
366
|
|
367
367
|
yield
|
368
368
|
end
|
@@ -398,7 +398,7 @@ module ActionDispatch
|
|
398
398
|
# for root cases, where the latter is the correct one.
|
399
399
|
def self.normalize_path(path)
|
400
400
|
path = Journey::Router::Utils.normalize_path(path)
|
401
|
-
path.gsub!(%r{/(\(+)/?}, '\1/') unless
|
401
|
+
path.gsub!(%r{/(\(+)/?}, '\1/') unless %r{^/(\(+[^)]+\)){1,}$}.match?(path)
|
402
402
|
path
|
403
403
|
end
|
404
404
|
|
@@ -1668,7 +1668,6 @@ module ActionDispatch
|
|
1668
1668
|
end
|
1669
1669
|
|
1670
1670
|
private
|
1671
|
-
|
1672
1671
|
def parent_resource
|
1673
1672
|
@scope[:scope_level_resource]
|
1674
1673
|
end
|
@@ -156,7 +156,6 @@ module ActionDispatch
|
|
156
156
|
end
|
157
157
|
|
158
158
|
private
|
159
|
-
|
160
159
|
def polymorphic_url_for_action(action, record_or_hash, options)
|
161
160
|
polymorphic_url(record_or_hash, options.merge(action: action))
|
162
161
|
end
|
@@ -323,7 +322,6 @@ module ActionDispatch
|
|
323
322
|
end
|
324
323
|
|
325
324
|
private
|
326
|
-
|
327
325
|
def polymorphic_mapping(target, record)
|
328
326
|
if record.respond_to?(:to_model)
|
329
327
|
target._routes.polymorphic_mappings[record.to_model.model_name.name]
|
@@ -40,7 +40,6 @@ module ActionDispatch
|
|
40
40
|
end
|
41
41
|
|
42
42
|
private
|
43
|
-
|
44
43
|
def controller(req)
|
45
44
|
req.controller_class
|
46
45
|
rescue NameError => e
|
@@ -59,7 +58,6 @@ module ActionDispatch
|
|
59
58
|
end
|
60
59
|
|
61
60
|
private
|
62
|
-
|
63
61
|
def controller(_); @controller_class; end
|
64
62
|
end
|
65
63
|
|
@@ -215,7 +213,6 @@ module ActionDispatch
|
|
215
213
|
end
|
216
214
|
|
217
215
|
private
|
218
|
-
|
219
216
|
def optimized_helper(args)
|
220
217
|
params = parameterize_args(args) do
|
221
218
|
raise_generation_error(args)
|
@@ -839,7 +836,7 @@ module ActionDispatch
|
|
839
836
|
|
840
837
|
def recognize_path(path, environment = {})
|
841
838
|
method = (environment[:method] || "GET").to_s.upcase
|
842
|
-
path = Journey::Router::Utils.normalize_path(path) unless
|
839
|
+
path = Journey::Router::Utils.normalize_path(path) unless %r{://}.match?(path)
|
843
840
|
extras = environment[:extras] || {}
|
844
841
|
|
845
842
|
begin
|
@@ -215,13 +215,11 @@ module ActionDispatch
|
|
215
215
|
end
|
216
216
|
|
217
217
|
protected
|
218
|
-
|
219
218
|
def optimize_routes_generation?
|
220
219
|
_routes.optimize_routes_generation? && default_url_options.empty?
|
221
220
|
end
|
222
221
|
|
223
222
|
private
|
224
|
-
|
225
223
|
def _with_routes(routes) # :doc:
|
226
224
|
old_routes, @_routes = @_routes, routes
|
227
225
|
yield
|
@@ -118,6 +118,7 @@ module ActionDispatch
|
|
118
118
|
|
119
119
|
def initialize(*) # :nodoc:
|
120
120
|
super
|
121
|
+
self.class.driven_by(:selenium) unless self.class.driver?
|
121
122
|
self.class.driver.use
|
122
123
|
@proxy_route = if ActionDispatch.test_app
|
123
124
|
Class.new do
|
@@ -166,11 +167,9 @@ module ActionDispatch
|
|
166
167
|
def self.driven_by(driver, using: :chrome, screen_size: [1400, 1400], options: {}, &capabilities)
|
167
168
|
driver_options = { using: using, screen_size: screen_size, options: options }
|
168
169
|
|
169
|
-
self.driver = SystemTesting::Driver.new(driver, driver_options, &capabilities)
|
170
|
+
self.driver = SystemTesting::Driver.new(driver, **driver_options, &capabilities)
|
170
171
|
end
|
171
172
|
|
172
|
-
driven_by :selenium
|
173
|
-
|
174
173
|
def method_missing(method, *args, &block)
|
175
174
|
if @proxy_route.respond_to?(method)
|
176
175
|
@proxy_route.send(method, *args, &block)
|
@@ -10,7 +10,7 @@ module ActionDispatch
|
|
10
10
|
@options = options[:options]
|
11
11
|
@capabilities = capabilities
|
12
12
|
|
13
|
-
@browser.preload
|
13
|
+
@browser.preload unless name == :rack_test
|
14
14
|
end
|
15
15
|
|
16
16
|
def use
|
@@ -45,7 +45,7 @@ module ActionDispatch
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def register_selenium(app)
|
48
|
-
Capybara::Selenium::Driver.new(app, { browser: @browser.type }.merge(browser_options)).tap do |driver|
|
48
|
+
Capybara::Selenium::Driver.new(app, **{ browser: @browser.type }.merge(browser_options)).tap do |driver|
|
49
49
|
driver.browser.manage.window.size = Selenium::WebDriver::Dimension.new(*@screen_size)
|
50
50
|
end
|
51
51
|
end
|
@@ -44,8 +44,8 @@ module ActionDispatch
|
|
44
44
|
|
45
45
|
# Performs a HEAD request with the given parameters. See ActionDispatch::Integration::Session#process
|
46
46
|
# for more details.
|
47
|
-
def head(path,
|
48
|
-
process(:head, path,
|
47
|
+
def head(path, **args)
|
48
|
+
process(:head, path, **args)
|
49
49
|
end
|
50
50
|
|
51
51
|
# Follow a single redirect response. If the last response was not a
|
@@ -310,6 +310,7 @@ module ActionDispatch
|
|
310
310
|
APP_SESSIONS = {}
|
311
311
|
|
312
312
|
attr_reader :app
|
313
|
+
attr_accessor :root_session # :nodoc:
|
313
314
|
|
314
315
|
def initialize(*args, &blk)
|
315
316
|
super(*args, &blk)
|
@@ -348,15 +349,19 @@ module ActionDispatch
|
|
348
349
|
end
|
349
350
|
|
350
351
|
%w(get post patch put head delete cookies assigns follow_redirect!).each do |method|
|
351
|
-
define_method(method) do |*args|
|
352
|
+
define_method(method) do |*args, **options|
|
352
353
|
# reset the html_document variable, except for cookies/assigns calls
|
353
354
|
unless method == "cookies" || method == "assigns"
|
354
355
|
@html_document = nil
|
355
356
|
end
|
356
357
|
|
357
|
-
|
358
|
-
|
358
|
+
result = if options.any?
|
359
|
+
integration_session.__send__(method, *args, **options)
|
360
|
+
else
|
361
|
+
integration_session.__send__(method, *args)
|
359
362
|
end
|
363
|
+
copy_session_variables!
|
364
|
+
result
|
360
365
|
end
|
361
366
|
end
|
362
367
|
|
@@ -373,10 +378,19 @@ module ActionDispatch
|
|
373
378
|
def open_session
|
374
379
|
dup.tap do |session|
|
375
380
|
session.reset!
|
381
|
+
session.root_session = self.root_session || self
|
376
382
|
yield session if block_given?
|
377
383
|
end
|
378
384
|
end
|
379
385
|
|
386
|
+
def assertions # :nodoc:
|
387
|
+
root_session ? root_session.assertions : super
|
388
|
+
end
|
389
|
+
|
390
|
+
def assertions=(assertions) # :nodoc:
|
391
|
+
root_session ? root_session.assertions = assertions : super
|
392
|
+
end
|
393
|
+
|
380
394
|
# Copy the instance variables from the current session instance into the
|
381
395
|
# test instance.
|
382
396
|
def copy_session_variables! #:nodoc:
|
@@ -408,6 +422,7 @@ module ActionDispatch
|
|
408
422
|
super
|
409
423
|
end
|
410
424
|
end
|
425
|
+
ruby2_keywords(:method_missing) if respond_to?(:ruby2_keywords, true)
|
411
426
|
end
|
412
427
|
end
|
413
428
|
|
@@ -640,8 +655,8 @@ module ActionDispatch
|
|
640
655
|
@@app = app
|
641
656
|
end
|
642
657
|
|
643
|
-
def register_encoder(*args)
|
644
|
-
RequestEncoder.register_encoder(*args)
|
658
|
+
def register_encoder(*args, **options)
|
659
|
+
RequestEncoder.register_encoder(*args, **options)
|
645
660
|
end
|
646
661
|
end
|
647
662
|
|
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: 6.0.
|
4
|
+
version: 6.0.3.3
|
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: 2020-
|
11
|
+
date: 2020-09-09 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: 6.0.
|
19
|
+
version: 6.0.3.3
|
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: 6.0.
|
26
|
+
version: 6.0.3.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,28 +98,28 @@ dependencies:
|
|
98
98
|
requirements:
|
99
99
|
- - '='
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version: 6.0.
|
101
|
+
version: 6.0.3.3
|
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: 6.0.
|
108
|
+
version: 6.0.3.3
|
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: 6.0.
|
115
|
+
version: 6.0.3.3
|
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: 6.0.
|
122
|
+
version: 6.0.3.3
|
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
|
@@ -310,10 +310,10 @@ licenses:
|
|
310
310
|
- MIT
|
311
311
|
metadata:
|
312
312
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
313
|
-
changelog_uri: https://github.com/rails/rails/blob/v6.0.
|
314
|
-
documentation_uri: https://api.rubyonrails.org/v6.0.
|
315
|
-
mailing_list_uri: https://
|
316
|
-
source_code_uri: https://github.com/rails/rails/tree/v6.0.
|
313
|
+
changelog_uri: https://github.com/rails/rails/blob/v6.0.3.3/actionpack/CHANGELOG.md
|
314
|
+
documentation_uri: https://api.rubyonrails.org/v6.0.3.3/
|
315
|
+
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
316
|
+
source_code_uri: https://github.com/rails/rails/tree/v6.0.3.3/actionpack
|
317
317
|
post_install_message:
|
318
318
|
rdoc_options: []
|
319
319
|
require_paths:
|
@@ -330,7 +330,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
330
330
|
version: '0'
|
331
331
|
requirements:
|
332
332
|
- none
|
333
|
-
rubygems_version: 3.
|
333
|
+
rubygems_version: 3.1.2
|
334
334
|
signing_key:
|
335
335
|
specification_version: 4
|
336
336
|
summary: Web-flow and rendering framework putting the VC in MVC (part of Rails).
|