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.

Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +189 -372
  3. data/MIT-LICENSE +1 -1
  4. data/README.rdoc +2 -3
  5. data/lib/abstract_controller/asset_paths.rb +1 -1
  6. data/lib/abstract_controller/base.rb +7 -21
  7. data/lib/abstract_controller/caching/fragments.rb +2 -2
  8. data/lib/abstract_controller/caching.rb +1 -1
  9. data/lib/abstract_controller/callbacks.rb +21 -7
  10. data/lib/abstract_controller/collector.rb +4 -2
  11. data/lib/abstract_controller/error.rb +1 -1
  12. data/lib/abstract_controller/helpers.rb +3 -2
  13. data/lib/abstract_controller/logger.rb +1 -1
  14. data/lib/abstract_controller/railties/routes_helpers.rb +2 -0
  15. data/lib/abstract_controller/translation.rb +3 -2
  16. data/lib/abstract_controller/url_for.rb +4 -6
  17. data/lib/action_controller/api.rb +1 -1
  18. data/lib/action_controller/log_subscriber.rb +4 -3
  19. data/lib/action_controller/metal/conditional_get.rb +38 -1
  20. data/lib/action_controller/metal/content_security_policy.rb +1 -1
  21. data/lib/action_controller/metal/cookies.rb +1 -1
  22. data/lib/action_controller/metal/data_streaming.rb +5 -13
  23. data/lib/action_controller/metal/exceptions.rb +19 -30
  24. data/lib/action_controller/metal/flash.rb +6 -2
  25. data/lib/action_controller/metal/helpers.rb +1 -1
  26. data/lib/action_controller/metal/http_authentication.rb +17 -16
  27. data/lib/action_controller/metal/instrumentation.rb +57 -52
  28. data/lib/action_controller/metal/live.rb +42 -2
  29. data/lib/action_controller/metal/mime_responds.rb +3 -3
  30. data/lib/action_controller/metal/params_wrapper.rb +20 -11
  31. data/lib/action_controller/metal/permissions_policy.rb +1 -1
  32. data/lib/action_controller/metal/redirecting.rb +86 -16
  33. data/lib/action_controller/metal/rendering.rb +7 -7
  34. data/lib/action_controller/metal/request_forgery_protection.rb +64 -24
  35. data/lib/action_controller/metal/rescue.rb +1 -1
  36. data/lib/action_controller/metal/streaming.rb +1 -3
  37. data/lib/action_controller/metal/strong_parameters.rb +84 -47
  38. data/lib/action_controller/metal/testing.rb +0 -2
  39. data/lib/action_controller/metal.rb +7 -10
  40. data/lib/action_controller/railtie.rb +49 -6
  41. data/lib/action_controller/test_case.rb +19 -4
  42. data/lib/action_controller.rb +1 -5
  43. data/lib/action_dispatch/http/cache.rb +13 -6
  44. data/lib/action_dispatch/http/content_security_policy.rb +39 -35
  45. data/lib/action_dispatch/http/filter_parameters.rb +5 -0
  46. data/lib/action_dispatch/http/mime_negotiation.rb +13 -3
  47. data/lib/action_dispatch/http/mime_type.rb +9 -11
  48. data/lib/action_dispatch/http/parameters.rb +4 -4
  49. data/lib/action_dispatch/http/permissions_policy.rb +1 -1
  50. data/lib/action_dispatch/http/request.rb +10 -19
  51. data/lib/action_dispatch/http/response.rb +1 -13
  52. data/lib/action_dispatch/http/url.rb +11 -19
  53. data/lib/action_dispatch/journey/gtg/builder.rb +11 -12
  54. data/lib/action_dispatch/journey/gtg/simulator.rb +10 -4
  55. data/lib/action_dispatch/journey/gtg/transition_table.rb +77 -21
  56. data/lib/action_dispatch/journey/nodes/node.rb +70 -5
  57. data/lib/action_dispatch/journey/path/pattern.rb +22 -13
  58. data/lib/action_dispatch/journey/route.rb +6 -13
  59. data/lib/action_dispatch/journey/router/utils.rb +2 -2
  60. data/lib/action_dispatch/journey/router.rb +1 -1
  61. data/lib/action_dispatch/journey/routes.rb +3 -3
  62. data/lib/action_dispatch/journey/visualizer/fsm.js +49 -24
  63. data/lib/action_dispatch/journey/visualizer/index.html.erb +1 -1
  64. data/lib/action_dispatch/middleware/actionable_exceptions.rb +0 -1
  65. data/lib/action_dispatch/middleware/cookies.rb +8 -4
  66. data/lib/action_dispatch/middleware/debug_exceptions.rb +6 -4
  67. data/lib/action_dispatch/middleware/debug_locks.rb +3 -3
  68. data/lib/action_dispatch/middleware/exception_wrapper.rb +4 -0
  69. data/lib/action_dispatch/middleware/executor.rb +3 -0
  70. data/lib/action_dispatch/middleware/flash.rb +9 -11
  71. data/lib/action_dispatch/middleware/host_authorization.rb +49 -37
  72. data/lib/action_dispatch/middleware/remote_ip.rb +16 -4
  73. data/lib/action_dispatch/middleware/server_timing.rb +33 -0
  74. data/lib/action_dispatch/middleware/session/abstract_store.rb +1 -1
  75. data/lib/action_dispatch/middleware/show_exceptions.rb +17 -9
  76. data/lib/action_dispatch/middleware/stack.rb +27 -9
  77. data/lib/action_dispatch/middleware/static.rb +2 -6
  78. data/lib/action_dispatch/middleware/templates/rescues/_message_and_suggestions.html.erb +1 -1
  79. data/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb +4 -11
  80. data/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb +2 -2
  81. data/lib/action_dispatch/middleware/templates/rescues/blocked_host.html.erb +4 -3
  82. data/lib/action_dispatch/middleware/templates/rescues/blocked_host.text.erb +3 -1
  83. data/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb +4 -4
  84. data/lib/action_dispatch/middleware/templates/rescues/invalid_statement.html.erb +3 -3
  85. data/lib/action_dispatch/middleware/templates/rescues/layout.erb +28 -18
  86. data/lib/action_dispatch/middleware/templates/rescues/missing_exact_template.html.erb +3 -3
  87. data/lib/action_dispatch/middleware/templates/rescues/missing_template.html.erb +3 -3
  88. data/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb +3 -3
  89. data/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb +3 -3
  90. data/lib/action_dispatch/middleware/templates/rescues/unknown_action.html.erb +3 -3
  91. data/lib/action_dispatch/middleware/templates/routes/_table.html.erb +5 -14
  92. data/lib/action_dispatch/railtie.rb +8 -2
  93. data/lib/action_dispatch/request/session.rb +43 -13
  94. data/lib/action_dispatch/routing/inspector.rb +1 -1
  95. data/lib/action_dispatch/routing/mapper.rb +54 -78
  96. data/lib/action_dispatch/routing/redirection.rb +0 -2
  97. data/lib/action_dispatch/routing/route_set.rb +14 -6
  98. data/lib/action_dispatch/routing/routes_proxy.rb +1 -1
  99. data/lib/action_dispatch/routing/url_for.rb +1 -2
  100. data/lib/action_dispatch/routing.rb +2 -2
  101. data/lib/action_dispatch/system_test_case.rb +12 -6
  102. data/lib/action_dispatch/system_testing/browser.rb +2 -12
  103. data/lib/action_dispatch/system_testing/driver.rb +35 -11
  104. data/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb +10 -6
  105. data/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb +0 -8
  106. data/lib/action_dispatch/testing/assertions.rb +2 -5
  107. data/lib/action_dispatch/testing/integration.rb +6 -8
  108. data/lib/action_dispatch/testing/test_process.rb +3 -26
  109. data/lib/action_dispatch.rb +2 -1
  110. data/lib/action_pack/gem_version.rb +4 -4
  111. data/lib/action_pack.rb +1 -1
  112. 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 #:nodoc:
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 and Ajax request.
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}(#{definition})
367
+ def #{method}(...)
370
368
  #{reset_html_document}
371
369
 
372
- result = integration_session.#{method}(#{definition})
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! #:nodoc:
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) if respond_to?(:ruby2_keywords, true)
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('spongebob.png', 'image/png') }
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('spongebob.png', 'image/png', :binary) }
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.respond_to?(:fixture_path) && self.class.fixture_path &&
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
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  #--
4
- # Copyright (c) 2004-2020 David Heinemeier Hansson
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
@@ -7,10 +7,10 @@ module ActionPack
7
7
  end
8
8
 
9
9
  module VERSION
10
- MAJOR = 6
11
- MINOR = 1
12
- TINY = 4
13
- PRE = nil
10
+ MAJOR = 7
11
+ MINOR = 0
12
+ TINY = 0
13
+ PRE = "rc1"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  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-2020 David Heinemeier Hansson
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: 6.1.4
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-24 00:00:00.000000000 Z
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: 6.1.4
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: 6.1.4
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.9
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.9
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: 6.1.4
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: 6.1.4
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: 6.1.4
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: 6.1.4
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/v6.1.4/actionpack/CHANGELOG.md
313
- documentation_uri: https://api.rubyonrails.org/v6.1.4/
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/v6.1.4/actionpack
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.5.0
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: '0'
331
+ version: 1.3.1
330
332
  requirements:
331
333
  - none
332
- rubygems_version: 3.1.2
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).