hanami 3.0.1 → 3.0.2

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: 29601a37b77928f8529277ff1cb0c15f052b3928bead0a3e445d658639ad37a6
4
- data.tar.gz: d2ac2933b70202b2dafb0ac670bc6955d5fbb93e8158f872c287062b42e2f9de
3
+ metadata.gz: 81b34af999f72ddcdf23bc2e46f7ccf0309081a204ea8de05d37ff2a7a0e291d
4
+ data.tar.gz: 9865b0be73a46d5024e07cfcbab5ccfc83684c1e62510e350d6858d63fe2d972
5
5
  SHA512:
6
- metadata.gz: 8589c6729cd7c3040c3da48b2c4e7ae962143d8fab1d3414a5fa22775ea5570f5f5571f8f7e3ba24b7c9250bd094aa8c81305e8fd4bab41e469eee543ffcca91
7
- data.tar.gz: 02db55cd27edfe98fb4be41bd98617a89a39c29164a3d98e56e49c0439a5caddaef601e63b788ccdede92ad0c1f8f4bb8126b2bb9b4c51b874b9f408863ad0b5
6
+ metadata.gz: 3c7e9d7e1bf9b3a5ce33b674f6dbbe29d2ac0cb8d3781af06b81a1979880fb407ead4818f146898c108c59100770c8e2e2cc769a8a7bda6d481e59349842c1e7
7
+ data.tar.gz: fce29da1c42fa73c7835178507bd3c14e3c68ca4a0d093427a7e05a77b9a84f2bb848a9289dcc9cc2dc2668c417d13421b1512bc003ad8ebe2059bbfd3134e84
data/CHANGELOG.md CHANGED
@@ -35,11 +35,17 @@ A complete Hanami app is composed of multiple gems. For a complete overview of c
35
35
 
36
36
  ### Fixed
37
37
 
38
- - Don't attempt to inherit mailer template when `hanami-view` if not bundled (@katafrakt in #1611)
39
-
40
38
  ### Security
41
39
 
42
- [unreleased]: https://github.com/hanami/hanami/compare/v3.0.1...HEAD
40
+ [unreleased]: https://github.com/hanami/hanami/compare/v3.0.2...HEAD
41
+
42
+ ## [3.0.2] - 2026-08-21
43
+
44
+ ### Fixed
45
+
46
+ - Prefer response exposures over request params when preparing input for the view as part of an action auto-rendering. (@timriley in #1620)
47
+
48
+ [3.0.2]: https://github.com/hanami/hanami/compare/v3.0.1...v3.0.2
43
49
 
44
50
  ## [3.0.1] - 2026-07-03
45
51
 
@@ -37,6 +37,12 @@ module Hanami
37
37
  #
38
38
  # @since 2.0.0
39
39
  module InstanceMethods
40
+ # Options accepted by `Hanami::View#call` itself, which must never be given from request
41
+ # params.
42
+ #
43
+ # @api private
44
+ VIEW_RESERVED_KEYS = %i[format context layout].freeze
45
+
40
46
  # @api private
41
47
  attr_reader :view
42
48
 
@@ -89,18 +95,27 @@ module Hanami
89
95
 
90
96
  private
91
97
 
92
- # @api private
93
98
  def build_response(**options)
94
99
  options = options.merge(view_options: method(:view_options))
95
100
  super(**options)
96
101
  end
97
102
 
98
- # @api private
99
103
  def finish(req, res, halted)
100
- res.render(view, **req.params) if !halted && auto_render?(res)
104
+ res.render(view, **view_input(req, res)) if !halted && auto_render?(res)
101
105
  super
102
106
  end
103
107
 
108
+ # Returns the input for the automatically rendered view.
109
+ #
110
+ # Includes response exposures as well as request params. Exposures are given precedence;
111
+ # these are server-set and should not be overridden by the client.
112
+ #
113
+ # Drops any keys matching the keywords for `Hanami::View#call` itself, since these are
114
+ # behavioral controls and the client should have no say over how the view renders.
115
+ def view_input(req, res)
116
+ {**req.params.to_h.except(*VIEW_RESERVED_KEYS), **res.exposures}
117
+ end
118
+
104
119
  # @api private
105
120
  def _handle_exception(request, _response, _exception)
106
121
  super
@@ -7,7 +7,7 @@ module Hanami
7
7
  # @api private
8
8
  module Version
9
9
  # @api public
10
- VERSION = "3.0.1"
10
+ VERSION = "3.0.2"
11
11
 
12
12
  # @since 0.9.0
13
13
  # @api private
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanami
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hanakai team