actionpack 8.1.0.rc1 → 8.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c8381d10158212e4c059184fe5d92666b06c59d245fb71694323238d90eba282
4
- data.tar.gz: 0dc561b01b220cee074c0278ce18630f60772998a20804314efff2531ae0c4fb
3
+ metadata.gz: 8a6a9e8f62251d8a2effa940639912fb8780489767c229427b614b7832cfa9db
4
+ data.tar.gz: 4a1143a6c62f275e05c6ed9d8f19f0361ca7a2c208045421f9e0d7e5f7e0403b
5
5
  SHA512:
6
- metadata.gz: 901e992f68e437ee2b51ae434592ae48e1c1f90928d3274db316618abbd036ab5e019e03a94826ba6e9f1d7c84fbff1e8f3080e46a39eb5336c615f317bb1058
7
- data.tar.gz: 56cf6df4674a40dfd5d1c5084ae3d65566d72f3db8e0b848217fceb2d3a5e0b488ac22f87fe457507d66346c330b9946b641117667ea7308854d0029a0e7ef8a
6
+ metadata.gz: 9aaa8fb203ce8b597633893fa89e55948012c7c9b8d0f8e73296fe589933dc31c047d11ff7170b905cef1e023ba5a9afb1f9c165c574bee54f90f73b5a707b31
7
+ data.tar.gz: db8d534af910c0bf937de64d457c24e20739c2e814b95363c9fae5726f723e7c2fc416aa94fc90754929f899095a6bdbc7f4bc9ef752010e49844cb7362d1dc7
data/CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
- ## Rails 8.1.0.rc1 (October 15, 2025) ##
1
+ ## Rails 8.1.0 (October 22, 2025) ##
2
+
3
+ * Submit test requests using `as: :html` with `Content-Type: x-www-form-urlencoded`
4
+
5
+ *Sean Doyle*
2
6
 
3
7
  * Add link-local IP ranges to `ActionDispatch::RemoteIp` default proxies.
4
8
 
@@ -100,8 +104,6 @@
100
104
 
101
105
  *Roberto Miranda*
102
106
 
103
- ## Rails 8.1.0.beta1 (September 04, 2025) ##
104
-
105
107
  * Remove deprecated support to a route to multiple paths.
106
108
 
107
109
  *Rafael Mendonça França*
@@ -90,7 +90,7 @@ module AbstractController
90
90
  #--
91
91
  # Implemented by Resolution#modules_for_helpers.
92
92
 
93
- # :method: # all_helpers_from_path
93
+ # :method: all_helpers_from_path
94
94
  # :call-seq: all_helpers_from_path(path)
95
95
  #
96
96
  # Returns a list of helper names in a given path.
@@ -108,10 +108,7 @@ module ActionController
108
108
  # ### Open Redirect protection
109
109
  #
110
110
  # By default, Rails protects against redirecting to external hosts for your
111
- # app's safety, so called open redirects. Note: this was a new default in Rails
112
- # 7.0, after upgrading opt-in by uncommenting the line with
113
- # `raise_on_open_redirects` in
114
- # `config/initializers/new_framework_defaults_7_0.rb`
111
+ # app's safety, so called open redirects.
115
112
  #
116
113
  # Here #redirect_to automatically validates the potentially-unsafe URL:
117
114
  #
@@ -34,6 +34,7 @@ module ActionController
34
34
  controller: payload[:controller],
35
35
  action: payload[:action],
36
36
  status: status,
37
+ **additions_for(payload),
37
38
  duration_ms: event.duration.round(2),
38
39
  gc_time_ms: event.gc_time.round(1),
39
40
  }.compact)
@@ -101,6 +102,10 @@ module ActionController
101
102
  duration_ms: event.duration.round(1)
102
103
  )
103
104
  end
105
+
106
+ def additions_for(payload)
107
+ payload.slice(:view_runtime, :db_runtime, :queries_count, :cached_queries_count)
108
+ end
104
109
  end
105
110
  end
106
111
 
@@ -1948,8 +1948,10 @@ module ActionDispatch
1948
1948
  end
1949
1949
 
1950
1950
  scope_options = options.slice!(*RESOURCE_OPTIONS)
1951
- if !scope_options.empty? || !shallow.nil?
1952
- scope(**scope_options, shallow:) do
1951
+ scope_options[:shallow] = shallow unless shallow.nil?
1952
+
1953
+ unless scope_options.empty?
1954
+ scope(**scope_options) do
1953
1955
  public_send(method, resources.pop, **options, &block)
1954
1956
  end
1955
1957
  return true
@@ -3,6 +3,7 @@
3
3
  # :markup: markdown
4
4
 
5
5
  require "nokogiri"
6
+ require "action_dispatch/http/mime_type"
6
7
 
7
8
  module ActionDispatch
8
9
  class RequestEncoder # :nodoc:
@@ -15,9 +16,9 @@ module ActionDispatch
15
16
 
16
17
  @encoders = { identity: IdentityEncoder.new }
17
18
 
18
- attr_reader :response_parser
19
+ attr_reader :response_parser, :content_type
19
20
 
20
- def initialize(mime_name, param_encoder, response_parser)
21
+ def initialize(mime_name, param_encoder, response_parser, content_type)
21
22
  @mime = Mime[mime_name]
22
23
 
23
24
  unless @mime
@@ -27,10 +28,7 @@ module ActionDispatch
27
28
 
28
29
  @response_parser = response_parser || -> body { body }
29
30
  @param_encoder = param_encoder || :"to_#{@mime.symbol}".to_proc
30
- end
31
-
32
- def content_type
33
- @mime.to_s
31
+ @content_type = content_type || @mime.to_s
34
32
  end
35
33
 
36
34
  def accept_header
@@ -50,11 +48,13 @@ module ActionDispatch
50
48
  @encoders[name] || @encoders[:identity]
51
49
  end
52
50
 
53
- def self.register_encoder(mime_name, param_encoder: nil, response_parser: nil)
54
- @encoders[mime_name] = new(mime_name, param_encoder, response_parser)
51
+ def self.register_encoder(mime_name, param_encoder: nil, response_parser: nil, content_type: nil)
52
+ @encoders[mime_name] = new(mime_name, param_encoder, response_parser, content_type)
55
53
  end
56
54
 
57
- register_encoder :html, response_parser: -> body { Rails::Dom::Testing.html_document.parse(body) }
55
+ register_encoder :html, response_parser: -> body { Rails::Dom::Testing.html_document.parse(body) },
56
+ param_encoder: -> param { param },
57
+ content_type: Mime[:url_encoded_form].to_s
58
58
  register_encoder :json, response_parser: -> body { JSON.parse(body, object_class: ActiveSupport::HashWithIndifferentAccess) }
59
59
  end
60
60
  end
@@ -12,7 +12,7 @@ module ActionPack
12
12
  MAJOR = 8
13
13
  MINOR = 1
14
14
  TINY = 0
15
- PRE = "rc1"
15
+ PRE = nil
16
16
 
17
17
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
18
18
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actionpack
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.1.0.rc1
4
+ version: 8.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 8.1.0.rc1
18
+ version: 8.1.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - '='
24
24
  - !ruby/object:Gem::Version
25
- version: 8.1.0.rc1
25
+ version: 8.1.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: nokogiri
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -127,28 +127,28 @@ dependencies:
127
127
  requirements:
128
128
  - - '='
129
129
  - !ruby/object:Gem::Version
130
- version: 8.1.0.rc1
130
+ version: 8.1.0
131
131
  type: :runtime
132
132
  prerelease: false
133
133
  version_requirements: !ruby/object:Gem::Requirement
134
134
  requirements:
135
135
  - - '='
136
136
  - !ruby/object:Gem::Version
137
- version: 8.1.0.rc1
137
+ version: 8.1.0
138
138
  - !ruby/object:Gem::Dependency
139
139
  name: activemodel
140
140
  requirement: !ruby/object:Gem::Requirement
141
141
  requirements:
142
142
  - - '='
143
143
  - !ruby/object:Gem::Version
144
- version: 8.1.0.rc1
144
+ version: 8.1.0
145
145
  type: :development
146
146
  prerelease: false
147
147
  version_requirements: !ruby/object:Gem::Requirement
148
148
  requirements:
149
149
  - - '='
150
150
  - !ruby/object:Gem::Version
151
- version: 8.1.0.rc1
151
+ version: 8.1.0
152
152
  description: Web apps on Rails. Simple, battle-tested conventions for building and
153
153
  testing MVC web applications. Works with any Rack-compatible server.
154
154
  email: david@loudthinking.com
@@ -352,10 +352,10 @@ licenses:
352
352
  - MIT
353
353
  metadata:
354
354
  bug_tracker_uri: https://github.com/rails/rails/issues
355
- changelog_uri: https://github.com/rails/rails/blob/v8.1.0.rc1/actionpack/CHANGELOG.md
356
- documentation_uri: https://api.rubyonrails.org/v8.1.0.rc1/
355
+ changelog_uri: https://github.com/rails/rails/blob/v8.1.0/actionpack/CHANGELOG.md
356
+ documentation_uri: https://api.rubyonrails.org/v8.1.0/
357
357
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
358
- source_code_uri: https://github.com/rails/rails/tree/v8.1.0.rc1/actionpack
358
+ source_code_uri: https://github.com/rails/rails/tree/v8.1.0/actionpack
359
359
  rubygems_mfa_required: 'true'
360
360
  rdoc_options: []
361
361
  require_paths: