hanami-action 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 +4 -4
- data/CHANGELOG.md +9 -5
- data/lib/hanami/action/params.rb +19 -4
- data/lib/hanami/action/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ead66d07305c1ab423774ef35b1aba0d6f280aa0d0921299f8daca4e4130e09e
|
|
4
|
+
data.tar.gz: 0ce91d088d253b5daa993c768ecb633bf128e411fb0257b2594dd8cefdd80b23
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a48f8dac73391046b11a1236b98020c555f49d73251af2bb34a84198709e8e9365d80f1044a2f5089d9ba7656d479627a187fabaf094c045bb4325cad5d9e09a
|
|
7
|
+
data.tar.gz: a09c190e05396f4cf7ca9747109f961714ca164ff1cb7594319ff28b014278152ae0ac1ae319ca26e1726a7fb1abcaa8bbf355df24afc9eada5b453bb96a62a6
|
data/CHANGELOG.md
CHANGED
|
@@ -9,12 +9,8 @@ and this project adheres to [Break Versioning](https://www.taoensso.com/break-ve
|
|
|
9
9
|
|
|
10
10
|
### Added
|
|
11
11
|
|
|
12
|
-
- Support additional `Cache-Control` directives in `response.cache_control`: `:immutable`, `:must_understand`, `stale_while_revalidate:` (requires a duration) and `stale_if_error:` (requires a duration). (@timriley in #522)
|
|
13
|
-
|
|
14
12
|
### Changed
|
|
15
13
|
|
|
16
|
-
- `response.cache_control` raises `ArgumentError` for unknown directives instead of silently dropping them. (@timriley in #522)
|
|
17
|
-
|
|
18
14
|
### Deprecated
|
|
19
15
|
|
|
20
16
|
### Removed
|
|
@@ -23,7 +19,15 @@ and this project adheres to [Break Versioning](https://www.taoensso.com/break-ve
|
|
|
23
19
|
|
|
24
20
|
### Security
|
|
25
21
|
|
|
26
|
-
[Unreleased]: https://github.com/hanami/hanami-action/compare/v3.0.
|
|
22
|
+
[Unreleased]: https://github.com/hanami/hanami-action/compare/v3.0.2...HEAD
|
|
23
|
+
|
|
24
|
+
## [3.0.2] - 2026-11-24
|
|
25
|
+
|
|
26
|
+
### Security
|
|
27
|
+
|
|
28
|
+
- Give route params precedence over query string and form body params with the same name in actions with a contract. Route params have Symbol keys and the others have String keys, so both were kept and the contract read the query or form value, letting `?id=2` override the `:id` in `/users/1`. (@parndt in GHSA-55j2-5pph-56mv)
|
|
29
|
+
|
|
30
|
+
[3.0.2]: https://github.com/hanami/hanami-action/compare/v3.0.1...v3.0.2
|
|
27
31
|
|
|
28
32
|
## [3.0.1] - 2026-07-03
|
|
29
33
|
|
data/lib/hanami/action/params.rb
CHANGED
|
@@ -324,14 +324,29 @@ module Hanami
|
|
|
324
324
|
result = {}
|
|
325
325
|
rack_request = ::Rack::Request.new(env) if has_query || has_form_body
|
|
326
326
|
|
|
327
|
-
result
|
|
328
|
-
result
|
|
329
|
-
result
|
|
330
|
-
result
|
|
327
|
+
_merge_params(result, rack_request.GET) if has_query
|
|
328
|
+
_merge_params(result, rack_request.POST) if has_form_body
|
|
329
|
+
_merge_params(result, env[ROUTER_PARAMS]) if has_router_params
|
|
330
|
+
_merge_params(result, env[ACTION_BODY_PARAMS]) if has_body_params
|
|
331
331
|
|
|
332
332
|
result
|
|
333
333
|
end
|
|
334
334
|
|
|
335
|
+
# Merges params, replacing any existing value for the same key, whether it was stored with
|
|
336
|
+
# a String or a Symbol key. Route params have Symbol keys while the others have String keys,
|
|
337
|
+
# so without this a query or form param could sit alongside the route param it was meant to
|
|
338
|
+
# be overridden by, and a contract would read the query or form value instead.
|
|
339
|
+
def _merge_params(result, params)
|
|
340
|
+
params.each do |key, value|
|
|
341
|
+
if key.is_a?(Symbol)
|
|
342
|
+
result.delete(key.name)
|
|
343
|
+
elsif key.valid_encoding?
|
|
344
|
+
result.delete(key.to_sym)
|
|
345
|
+
end
|
|
346
|
+
result[key] = value
|
|
347
|
+
end
|
|
348
|
+
end
|
|
349
|
+
|
|
335
350
|
def _form_content_type?(content_type)
|
|
336
351
|
return false unless content_type
|
|
337
352
|
|