hanami-controller 2.3.1 → 2.3.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 +491 -341
- data/LICENSE +20 -0
- data/README.md +13 -23
- data/hanami-controller.gemspec +25 -18
- data/lib/hanami/action/cache/conditional_get.rb +1 -1
- data/lib/hanami/action/config/formats.rb +1 -1
- data/lib/hanami/action/flash.rb +1 -1
- data/lib/hanami/action/mime.rb +1 -1
- data/lib/hanami/action/response.rb +1 -1
- data/lib/hanami/action.rb +2 -2
- data/lib/hanami/controller/version.rb +1 -1
- metadata +16 -65
- data/LICENSE.md +0 -22
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Changelog
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Break Versioning](https://www.taoensso.com/break-versioning).
|
|
4
7
|
|
|
5
8
|
## [Unreleased]
|
|
6
9
|
|
|
@@ -16,7 +19,15 @@ Complete, fast and testable actions for Rack
|
|
|
16
19
|
|
|
17
20
|
### Security
|
|
18
21
|
|
|
19
|
-
[Unreleased]: https://github.com/hanami/hanami-controller/compare/v2.3.
|
|
22
|
+
[Unreleased]: https://github.com/hanami/hanami-controller/compare/v2.3.2...HEAD
|
|
23
|
+
|
|
24
|
+
## [2.3.2] - 2026-06-12
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- Allow the gem to be eager loadeded by Zeitwerk. (@timriley in #515)
|
|
29
|
+
|
|
30
|
+
[2.3.2]: https://github.com/hanami/hanami-controller/compare/v2.3.1...v2.3.2
|
|
20
31
|
|
|
21
32
|
## [2.3.1] - 2025-12-06
|
|
22
33
|
|
|
@@ -35,7 +46,7 @@ Complete, fast and testable actions for Rack
|
|
|
35
46
|
|
|
36
47
|
[2.3.1]: https://github.com/hanami/hanami-controller/compare/v2.3.0...v2.3.1
|
|
37
48
|
|
|
38
|
-
##
|
|
49
|
+
## [2.3.0] - 2025-11-12
|
|
39
50
|
|
|
40
51
|
### Added
|
|
41
52
|
|
|
@@ -52,7 +63,7 @@ Complete, fast and testable actions for Rack
|
|
|
52
63
|
config.handle_exception "ROM::TupleCountMismatchError" => 404
|
|
53
64
|
end
|
|
54
65
|
```
|
|
55
|
-
- Allow both `:unprocessable_entity` and `:unprocessable_content` and
|
|
66
|
+
- Allow both `:unprocessable_entity` and `:unprocessable_content` and to be used to refer to the 422 HTTP status code (Rack v3 dropped the former and replaced it with the latter). (@alassek in #490)
|
|
56
67
|
|
|
57
68
|
```ruby
|
|
58
69
|
def handle(request, response)
|
|
@@ -61,11 +72,13 @@ Complete, fast and testable actions for Rack
|
|
|
61
72
|
end
|
|
62
73
|
```
|
|
63
74
|
|
|
64
|
-
|
|
75
|
+
[2.3.0]: https://github.com/hanami/hanami-controller/compare/v2.3.0.beta2...v2.3.0
|
|
76
|
+
|
|
77
|
+
## [2.3.0.beta2] - 2025-10-17
|
|
65
78
|
|
|
66
79
|
### Added
|
|
67
80
|
|
|
68
|
-
-
|
|
81
|
+
- Make format config more flexible. (Tim Riley in #485)
|
|
69
82
|
|
|
70
83
|
**Use `config.formats.register` to register a new format and its media types.**
|
|
71
84
|
|
|
@@ -131,646 +144,783 @@ Complete, fast and testable actions for Rack
|
|
|
131
144
|
|
|
132
145
|
### Changed
|
|
133
146
|
|
|
134
|
-
-
|
|
135
|
-
-
|
|
147
|
+
- `Action.format`, `config.format`, `config.formats.add`, `config.formats.values`, and `config.formats.values=` are deprecated and will be removed in Hanami 2.4. (Tim Riley in #485)
|
|
148
|
+
- Drop support for Ruby 3.1. (Tim Riley in #485)
|
|
136
149
|
|
|
137
|
-
|
|
150
|
+
[2.3.0.beta2]: https://github.com/hanami/hanami-controller/compare/v2.3.0.beta1...v2.3.0.beta2
|
|
138
151
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
- [wuarmin] Avoid false negatives in format/content type matches by checking against the request's media type, which excludes content type parameters (e.g. "test/plain" instead of "text/plain;charset=utf-8") (#471)
|
|
152
|
+
## [2.3.0.beta1] - 2025-10-03
|
|
142
153
|
|
|
143
154
|
### Added
|
|
144
155
|
|
|
145
|
-
-
|
|
156
|
+
- Add `Request#subdomains`, returning an array of subdomains for the current host, and `Request#subdomain` returning a dot-delimited subdomain string for the current host. Add `config.default_tld_length` setting for configuring the TLD length for your app's expected domain. (Wout in #481)
|
|
146
157
|
|
|
147
158
|
### Changed
|
|
148
159
|
|
|
149
|
-
-
|
|
150
|
-
-
|
|
160
|
+
- Support Rack 3 in addition to Rack 2. (Kyle Plump, Tim Riley in #460)
|
|
161
|
+
- `request.session` is now an instance of `Hanami::Action::Request::Session`, which wraps the session object and provides access to session values via symbol keys. This was previously handled via symbolizing and reassigning the entire session hash, which is not compatible with Rack 3. (Tim Riley in #477)
|
|
162
|
+
|
|
163
|
+
### Fixed
|
|
164
|
+
|
|
165
|
+
- Avoid false negatives in format/content type matches by checking against the request's media type, which excludes content type parameters (e.g. "test/plain" instead of "text/plain;charset=utf-8"). (wuarmin in #471)
|
|
151
166
|
|
|
152
|
-
|
|
167
|
+
[2.3.0.beta1]: https://github.com/hanami/hanami-controller/compare/v2.2.0...v2.3.0.beta1
|
|
168
|
+
|
|
169
|
+
## [2.2.0] - 2024-11-05
|
|
153
170
|
|
|
154
171
|
### Added
|
|
155
172
|
|
|
156
|
-
-
|
|
173
|
+
- When an action is called, add the action instance to the Rack environment under the `"hanami.action_instance"` key. (Tom de Bruijn, Tim Riley in #446)
|
|
174
|
+
|
|
175
|
+
[2.2.0]: https://github.com/hanami/hanami-controller/compare/v2.2.0.rc1...v2.2.0
|
|
176
|
+
|
|
177
|
+
## [2.2.0.rc1] - 2024-10-29
|
|
157
178
|
|
|
158
|
-
|
|
179
|
+
[2.2.0.rc1]: https://github.com/hanami/hanami-controller/compare/v2.2.0.beta2...v2.2.0.rc1
|
|
159
180
|
|
|
160
|
-
##
|
|
181
|
+
## [2.2.0.beta2] - 2024-09-25
|
|
161
182
|
|
|
162
183
|
### Added
|
|
163
184
|
|
|
164
|
-
-
|
|
185
|
+
- Add support for using full dry-validation contracts for action param validation, via `Hanami::Action.contract`. (Tim Riley, Krzysztof Piotrowski in #453, #454)
|
|
165
186
|
|
|
166
|
-
|
|
187
|
+
[2.2.0.beta2]: https://github.com/hanami/hanami-controller/compare/v2.2.0.beta1...v2.2.0.beta2
|
|
188
|
+
|
|
189
|
+
## [2.2.0.beta1] - 2024-07-16
|
|
167
190
|
|
|
168
191
|
### Changed
|
|
169
192
|
|
|
170
|
-
- Drop support for Ruby 3.0
|
|
193
|
+
- Drop support for Ruby 3.0. (Tim Riley in #454)
|
|
194
|
+
|
|
195
|
+
[2.2.0.beta1]: https://github.com/hanami/hanami-controller/compare/v2.1.0...v2.2.0.beta1
|
|
196
|
+
|
|
197
|
+
## [2.1.0] - 2024-02-27
|
|
198
|
+
|
|
199
|
+
[2.1.0]: https://github.com/hanami/hanami-controller/compare/v2.1.0.rc3...v2.1.0
|
|
171
200
|
|
|
172
|
-
##
|
|
201
|
+
## [2.1.0.rc3] - 2024-02-16
|
|
173
202
|
|
|
174
|
-
|
|
203
|
+
[2.1.0.rc3]: https://github.com/hanami/hanami-controller/compare/v2.1.0.rc2...v2.1.0.rc3
|
|
175
204
|
|
|
176
|
-
##
|
|
205
|
+
## [2.1.0.rc2] - 2023-11-08
|
|
177
206
|
|
|
178
|
-
|
|
207
|
+
[2.1.0.rc2]: https://github.com/hanami/hanami-controller/compare/v2.1.0.rc1...v2.1.0.rc2
|
|
208
|
+
|
|
209
|
+
## [2.1.0.rc1] - 2023-11-01
|
|
179
210
|
|
|
180
211
|
### Fixed
|
|
181
212
|
|
|
182
|
-
-
|
|
213
|
+
- Ensure Rack compatibility of `Hanami::Action::Response#send_file`. (Luca Guidi in #431)
|
|
214
|
+
|
|
215
|
+
[2.1.0.rc1]: https://github.com/hanami/hanami-controller/compare/v2.1.0.beta2...v2.1.0.rc1
|
|
183
216
|
|
|
184
|
-
##
|
|
217
|
+
## [2.1.0.beta2] - 2023-10-04
|
|
185
218
|
|
|
186
219
|
### Fixed
|
|
187
220
|
|
|
188
|
-
-
|
|
221
|
+
- `Hanami::Action::Config#root`: don't check realpath existence to simplify the boot process of Hanami. (Luca Guidi in #429)
|
|
222
|
+
|
|
223
|
+
[2.1.0.beta2]: https://github.com/hanami/hanami-controller/compare/v2.1.0.beta1...v2.1.0.beta2
|
|
189
224
|
|
|
190
|
-
##
|
|
225
|
+
## [2.1.0.beta1] - 2023-06-29
|
|
191
226
|
|
|
192
227
|
### Added
|
|
193
228
|
|
|
194
|
-
-
|
|
229
|
+
- Add `Request#session_enabled?` and `Response#session_enabled?`. (Tim Riley in #423)
|
|
195
230
|
|
|
196
|
-
|
|
231
|
+
[2.1.0.beta1]: https://github.com/hanami/hanami-controller/compare/v2.0.2...v2.1.0.beta1
|
|
232
|
+
|
|
233
|
+
## [2.0.2] - 2023-02-01
|
|
197
234
|
|
|
198
235
|
### Added
|
|
199
236
|
|
|
200
|
-
-
|
|
201
|
-
-
|
|
202
|
-
-
|
|
237
|
+
- Params Pattern Matching. (Adam Lassek in #417)
|
|
238
|
+
- Allow to `halt` using a `Symbol`: `halt :unauthorized`. (Adam Lassek, Luca Guidi in #418)
|
|
239
|
+
- Introduce `Hanami::Action::Response#status=` to accept an `Integer` or a `Symbol`. (Adam Lassek, Luca Guidi in #418)
|
|
203
240
|
|
|
204
241
|
### Fixed
|
|
205
242
|
|
|
206
|
-
-
|
|
207
|
-
-
|
|
208
|
-
-
|
|
243
|
+
- Ensure action accepting the request with a custom MIME Type. (Pat Allan in #409)
|
|
244
|
+
- Halting with an unknown HTTP code will raise a `Hanami::Action::UnknownHttpStatusError`. (Luca Guidi in #418)
|
|
245
|
+
- Fix error message for missing format (MIME Type). (Luca Guidi in #418)
|
|
246
|
+
|
|
247
|
+
[2.0.2]: https://github.com/hanami/hanami-controller/compare/v2.0.1...v2.0.2
|
|
209
248
|
|
|
210
|
-
##
|
|
249
|
+
## [2.0.1] - 2022-12-25
|
|
211
250
|
|
|
212
251
|
### Added
|
|
213
252
|
|
|
214
|
-
-
|
|
253
|
+
- Official support for Ruby 3.2. (Luca Guidi in #408)
|
|
215
254
|
|
|
216
|
-
|
|
255
|
+
[2.0.1]: https://github.com/hanami/hanami-controller/compare/v2.0.0...v2.0.1
|
|
256
|
+
|
|
257
|
+
## [2.0.0] - 2022-11-22
|
|
217
258
|
|
|
218
259
|
### Added
|
|
219
260
|
|
|
220
|
-
-
|
|
221
|
-
-
|
|
261
|
+
- Use Zeitwerk to autoload the gem. (Tim Riley in #401)
|
|
262
|
+
- Introduce `Hanami::Action::Config#formats`. Use `config.actions.formats.add(:json)`. Custom formats can use `config.actions.formats.add(:graphql, ["application/graphql"])`. (Tim Riley in #401)
|
|
222
263
|
|
|
223
264
|
### Changed
|
|
224
265
|
|
|
225
|
-
-
|
|
226
|
-
-
|
|
227
|
-
-
|
|
266
|
+
- Changed `Hanami::Action::Config#format` semantic: it's no longer used to add custom MIME Types, but as a macro to setup the wanted format for action(s). (Tim Riley in #401)
|
|
267
|
+
- Removed `Hanami::Action::Config#default_request_format` and `#default_response_format`, use `#format` for both. (Tim Riley in #401)
|
|
268
|
+
- Removed `Hanami::Action::Config#accept`, use `#format`. (Tim Riley in #401)
|
|
269
|
+
|
|
270
|
+
[2.0.0]: https://github.com/hanami/hanami-controller/compare/v2.0.0.rc1...v2.0.0
|
|
228
271
|
|
|
229
|
-
##
|
|
272
|
+
## [2.0.0.rc1] - 2022-11-08
|
|
230
273
|
|
|
231
274
|
### Changed
|
|
232
275
|
|
|
233
|
-
-
|
|
276
|
+
- Simplify assignment of response format: `response.format = :json` (was `response.format = format(:json)`). (Tim Riley in #400)
|
|
234
277
|
|
|
235
|
-
|
|
278
|
+
[2.0.0.rc1]: https://github.com/hanami/hanami-controller/compare/v2.0.0.beta4...v2.0.0.rc1
|
|
279
|
+
|
|
280
|
+
## [2.0.0.beta4] - 2022-10-24
|
|
236
281
|
|
|
237
282
|
### Added
|
|
238
283
|
|
|
239
|
-
-
|
|
284
|
+
- Add `Response#flash`, and delgate to request object for both `Response#session` and `Response#flash`, ensuring the same objects are used when accessed via either request or response. (Tim Riley in #399)
|
|
240
285
|
|
|
241
|
-
###
|
|
286
|
+
### Changed
|
|
242
287
|
|
|
243
|
-
-
|
|
244
|
-
-
|
|
288
|
+
- When `Action.accept` is declared (or `Action::Config.accepted_formats` configured), return a 406 error if an `Accept` request header is present but is not acceptable. In the absence of an `Accept` header, return a 415 error if a `Content-Type` header is present but not acceptable. If neither header is provided, accept the request. (Tim Riley in #396)
|
|
289
|
+
- Add `Action.handle_exception` class method as a shortcut for `Hanami::Action::Config#handle_exception`. (Tim Riley in #394)
|
|
290
|
+
- Significantly reduce memory usage by leveraging recent dry-configurable changes, and relocating `accepted_formats`, `before_callbacks`, `after_callbacks` inheritable attributes to `config`. (Tim Riley in #392)
|
|
291
|
+
- Make params validation schemas (defined in `params do` block) inheritable to subclasses. (Tim Riley in #394)
|
|
292
|
+
- Raise `Hanami::Action::MissingSessionError` with a friendly message if `Request#session`, `Request#flash`, `Response#session` or `Response#flash` are called for an action that does not already include `Hanami::Action:Session` mixin. (Benhamin Klotz, Tim Riley in #379, #395)
|
|
245
293
|
|
|
246
|
-
###
|
|
294
|
+
### Fixed
|
|
247
295
|
|
|
248
|
-
-
|
|
249
|
-
-
|
|
250
|
-
- [Tim Riley] Significantly reduce memory usage by leveraging recent dry-configurable changes, and relocating `accepted_formats`, `before_callbacks`, `after_callbacks` inheritable attributes to `config` (#392)
|
|
251
|
-
- [Tim Riley] Make params validation schemas (defined in `params do` block) inheritable to subclasses (#394)
|
|
252
|
-
- [Benhamin Klotz, Tim Riley] Raise `Hanami::Action::MissingSessionError` with a friendly message if `Request#session`, `Request#flash`, `Response#session` or `Response#flash` are called for an action that does not already include `Hanami::Action:Session` mixin (#379 via #395)
|
|
296
|
+
- When a params validation schema is provided (in a `params do` block), only return the validated params from `request.params`. (Benjamin Klotz in #375)
|
|
297
|
+
- Handle dry-schema's messages hash now being frozen by default. (Sean Collins in #391)
|
|
253
298
|
|
|
254
|
-
|
|
299
|
+
[2.0.0.beta4]: https://github.com/hanami/hanami-controller/compare/v2.0.0.beta1...v2.0.0.beta4
|
|
300
|
+
|
|
301
|
+
## [2.0.0.beta1] - 2022-07-20
|
|
255
302
|
|
|
256
303
|
### Fixed
|
|
257
304
|
|
|
258
|
-
-
|
|
259
|
-
-
|
|
260
|
-
-
|
|
261
|
-
-
|
|
305
|
+
- Using `Hanami::Action.params` without having `hanami-validations` installed now returns a user-friendly error. (Benjamin Klotz in #371)
|
|
306
|
+
- Ensure HEAD responses to send empty body, but preserve headers. (Narinda Reeders in #368)
|
|
307
|
+
- Ensure HEAD redirect responses to return redirect headers. (Narinda Reeders in #368)
|
|
308
|
+
- Do not automatically render halted requests. (Andrew Croome in #364)
|
|
309
|
+
|
|
310
|
+
[2.0.0.beta1]: https://github.com/hanami/hanami-controller/compare/v2.0.0.alpha8...v2.0.0.beta1
|
|
262
311
|
|
|
263
|
-
##
|
|
312
|
+
## [2.0.0.alpha8] - 2022-02-19
|
|
264
313
|
|
|
265
314
|
### Changed
|
|
266
315
|
|
|
267
|
-
-
|
|
316
|
+
- Removed automatic integration of `Hanami::Action` subclasses with their surrounding Hanami application. Action base classes within Hanami apps should inherit from `Hanami::Application::Action` instead. (Tim Riley in #362)
|
|
268
317
|
|
|
269
|
-
|
|
318
|
+
[2.0.0.alpha8]: https://github.com/hanami/hanami-controller/compare/v2.0.0.alpha6...v2.0.0.alpha8
|
|
319
|
+
|
|
320
|
+
## [2.0.0.alpha6] - 2022-02-10
|
|
270
321
|
|
|
271
322
|
### Added
|
|
272
323
|
|
|
273
|
-
-
|
|
324
|
+
- Official support for Ruby: MRI 3.1. (Luca Guidi in #359)
|
|
274
325
|
|
|
275
326
|
### Changed
|
|
276
327
|
|
|
277
|
-
-
|
|
278
|
-
-
|
|
328
|
+
- Drop support for Ruby: MRI 2.6, and 2.7. (Luca Guidi in #359)
|
|
329
|
+
- Align with Rack list of HTTP supported status. Added: `103`, `306`, `421`, `425`, `451`, and `509`. Removed: `418`, `420`, `444`, `449`, `450`, `451`, `499`, `598`, `599`. (Sean Collins in #358)
|
|
330
|
+
|
|
331
|
+
[2.0.0.alpha6]: https://github.com/hanami/hanami-controller/compare/v2.0.0.alpha5...v2.0.0.alpha6
|
|
279
332
|
|
|
280
|
-
##
|
|
333
|
+
## [2.0.0.alpha5] - 2022-01-12
|
|
281
334
|
|
|
282
335
|
### Added
|
|
283
336
|
|
|
284
|
-
-
|
|
337
|
+
- Added "rss" ("application/rss+xml") to list of supported MIME types. (Philip Arndt in #357)
|
|
338
|
+
|
|
339
|
+
[2.0.0.alpha5]: https://github.com/hanami/hanami-controller/compare/v2.0.0.alpha4...v2.0.0.alpha5
|
|
285
340
|
|
|
286
|
-
##
|
|
341
|
+
## [2.0.0.alpha4] - 2021-12-07
|
|
287
342
|
|
|
288
343
|
### Added
|
|
289
344
|
|
|
290
|
-
-
|
|
291
|
-
-
|
|
345
|
+
- Manage Content Security Policy (CSP) defaults and new API via `Hanami::Action::ApplicationConfiguration#content_security_policy`. (Luca Guidi in #354)
|
|
346
|
+
- Provide access to routes inside all application actions via `Hanami::Action::ApplicationAction#routes`. (Tim Riley & Marc Busqué in #352)
|
|
292
347
|
|
|
293
|
-
|
|
348
|
+
[2.0.0.alpha4]: https://github.com/hanami/hanami-controller/compare/v2.0.0.alpha3...v2.0.0.alpha4
|
|
349
|
+
|
|
350
|
+
## [2.0.0.alpha3] - 2021-11-09
|
|
294
351
|
|
|
295
352
|
### Added
|
|
296
353
|
|
|
297
|
-
-
|
|
298
|
-
-
|
|
354
|
+
- Automatically include session behavior in `Hanami::Action` when sessions are enabled via Hanami application config. (Luca Guidi in #347)
|
|
355
|
+
- Pass exposures from action to view. (Sean Collins in #348)
|
|
299
356
|
|
|
300
357
|
### Changed
|
|
301
358
|
|
|
302
|
-
-
|
|
303
|
-
-
|
|
359
|
+
- (Internal) Updated settings to use updated `setting` API in dry-configurable 0.13.0. (Tim Riley in #346)
|
|
360
|
+
- Move automatic view rendering from `handle` to `finish`. (Sean Collins in #348)
|
|
361
|
+
|
|
362
|
+
[2.0.0.alpha3]: https://github.com/hanami/hanami-controller/compare/v2.0.0.alpha2...v2.0.0.alpha3
|
|
304
363
|
|
|
305
|
-
##
|
|
364
|
+
## [2.0.0.alpha2] - 2021-05-04
|
|
306
365
|
|
|
307
366
|
### Added
|
|
308
367
|
|
|
309
|
-
-
|
|
310
|
-
-
|
|
311
|
-
-
|
|
312
|
-
-
|
|
313
|
-
-
|
|
314
|
-
-
|
|
315
|
-
-
|
|
368
|
+
- Official support for Ruby: MRI 3.0. (Luca Guidi in #325)
|
|
369
|
+
- Introduced `Hanami::Action::ApplicationAction`. (Tim Riley in #325)
|
|
370
|
+
- Introduced `Hanami::Action::Configuration`. (Tim Riley in #325)
|
|
371
|
+
- Introduced `Hanami::Action::ApplicationConfiguration`. (Tim Riley in #325)
|
|
372
|
+
- Auto-inject a paired view into any `Hanami::Action::ApplicationAction` instance. (Tim Riley in #325)
|
|
373
|
+
- Auto-render `Hanami::Action::ApplicationAction` subclasses that don't implement `#handle`. (Tim Riley in #325)
|
|
374
|
+
- Enable CSRF protection automatically when HTTP sessions are enabled. (Tim Riley in #325)
|
|
316
375
|
|
|
317
|
-
###
|
|
376
|
+
### Changed
|
|
318
377
|
|
|
319
|
-
-
|
|
320
|
-
-
|
|
378
|
+
- Drop support for Ruby: MRI 2.5. (Luca Guidi in #325)
|
|
379
|
+
- Removed `Hanami::Action.handle_exception` in favor of `Hanami::Action.config.handle_exception`. (Tim Riley in #325)
|
|
380
|
+
- Rewritten `Hanami::Action::Flash`, based on Roda's `FlashHash`. (Tim Riley in #325)
|
|
321
381
|
|
|
322
|
-
###
|
|
382
|
+
### Fixed
|
|
383
|
+
|
|
384
|
+
- Ensure `Hanami::Action::Response#renderable?` to return `false` when body is set. (Luca Guidi in #325)
|
|
385
|
+
- Ensure `Hanami::Action.accept` to use Rack `CONTENT_TYPE` for the _before callback_ check. (Andrew Croome in #325)
|
|
323
386
|
|
|
324
|
-
|
|
325
|
-
- [Tim Riley] Removed `Hanami::Action.handle_exception` in favor of `Hanami::Action.config.handle_exception`
|
|
326
|
-
- [Tim Riley] Rewritten `Hanami::Action::Flash`, based on Roda's `FlashHash`
|
|
387
|
+
[2.0.0.alpha2]: https://github.com/hanami/hanami-controller/compare/v2.0.0.alpha1...v2.0.0.alpha2
|
|
327
388
|
|
|
328
|
-
##
|
|
389
|
+
## [2.0.0.alpha1] - 2019-01-30
|
|
329
390
|
|
|
330
391
|
### Added
|
|
331
392
|
|
|
332
|
-
-
|
|
333
|
-
-
|
|
334
|
-
-
|
|
393
|
+
- `Hanami::Action::Request#session` to access the HTTP session as it was originally sent. (Luca Guidi in #281)
|
|
394
|
+
- `Hanami::Action::Request#cookies` to access the HTTP cookies as they were originally sent. (Luca Guidi in #281)
|
|
395
|
+
- Allow to build a deep inheritance chain for actions. (Luca Guidi & Tim Riley in #281)
|
|
335
396
|
|
|
336
397
|
### Changed
|
|
337
398
|
|
|
338
|
-
-
|
|
339
|
-
-
|
|
340
|
-
-
|
|
341
|
-
-
|
|
342
|
-
-
|
|
343
|
-
-
|
|
344
|
-
-
|
|
345
|
-
-
|
|
346
|
-
-
|
|
347
|
-
-
|
|
348
|
-
-
|
|
349
|
-
-
|
|
350
|
-
-
|
|
351
|
-
-
|
|
352
|
-
-
|
|
353
|
-
-
|
|
354
|
-
-
|
|
355
|
-
-
|
|
356
|
-
-
|
|
357
|
-
-
|
|
358
|
-
-
|
|
359
|
-
-
|
|
360
|
-
-
|
|
361
|
-
-
|
|
362
|
-
-
|
|
363
|
-
-
|
|
364
|
-
-
|
|
365
|
-
-
|
|
366
|
-
-
|
|
367
|
-
-
|
|
368
|
-
-
|
|
369
|
-
-
|
|
370
|
-
-
|
|
371
|
-
-
|
|
372
|
-
-
|
|
373
|
-
-
|
|
374
|
-
-
|
|
375
|
-
-
|
|
376
|
-
-
|
|
377
|
-
-
|
|
378
|
-
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
-
|
|
387
|
-
|
|
388
|
-
|
|
399
|
+
- Drop support for Ruby: MRI 2.3, and 2.4. (Luca Guidi in #281)
|
|
400
|
+
- `Hanami::Action` is a superclass. (Luca Guidi in #281)
|
|
401
|
+
- `Hanami::Action#initialize` requires a `configuration:` keyword argument. (Luca Guidi in #281)
|
|
402
|
+
- `Hanami::Action#initialize` returns a frozen action instance. (Luca Guidi in #281)
|
|
403
|
+
- `Hanami::Action` subclasses must implement `#handle` instead of `#call`. (Tim Riley in #281)
|
|
404
|
+
- `Hanami::Action#handle` accepts `Hanami::Action::Request` and `Hanami::Action::Response`. (Luca Guidi in #281)
|
|
405
|
+
- `Hanami::Action#handle` returns `Hanami::Action::Response`. (Luca Guidi in #281)
|
|
406
|
+
- Removed `Hanami::Controller.configure`, `.configuration`, `.duplicate`, and `.load!`. (Luca Guidi in #281)
|
|
407
|
+
- Removed `Hanami::Action.use` to mount Rack middleware at the action level. (Luca Guidi in #281)
|
|
408
|
+
- `Hanami::Controller::Configuration` changed syntax from DSL style to setters (eg. `Hanami::Controller::Configuration.new { |c| c.default_request_format = :html }`). (Luca Guidi in #281)
|
|
409
|
+
- `Hanami::Controller::Configuration#initialize` returns a frozen configuration instance. (Luca Guidi in #281)
|
|
410
|
+
- Removed `Hanami::Controller::Configuration#prepare`. (Luca Guidi in #281)
|
|
411
|
+
- Removed `Hanami::Action.configuration`. (Luca Guidi in #281)
|
|
412
|
+
- Removed `Hanami::Action.configuration.handle_exceptions`. (Luca Guidi in #281)
|
|
413
|
+
- Removed `Hanami::Action.configuration.default_request_format` in favor of `#default_request_format`. (Luca Guidi in #281)
|
|
414
|
+
- Removed `Hanami::Action.configuration.default_charset` in favor of `#default_charset`. (Luca Guidi in #281)
|
|
415
|
+
- Removed `Hanami::Action.configuration.format` to register a MIME Type for a single action. Please use the configuration. (Luca Guidi in #281)
|
|
416
|
+
- Removed `Hanami::Action.expose` in favor of `Hanami::Action::Response#[]=` and `#[]`. (Luca Guidi in #281)
|
|
417
|
+
- Removed `Hanami::Action#status=` in favor of `Hanami::Action::Response#status=`. (Luca Guidi in #281)
|
|
418
|
+
- Removed `Hanami::Action#body=` in favor of `Hanami::Action::Response#body=`. (Luca Guidi in #281)
|
|
419
|
+
- Removed `Hanami::Action#headers` in favor of `Hanami::Action::Response#headers`. (Luca Guidi in #281)
|
|
420
|
+
- Removed `Hanami::Action#accept?` in favor of `Hanami::Action::Request#accept?`. (Luca Guidi in #281)
|
|
421
|
+
- Removed `Hanami::Action#format` in favor of `Hanami::Action::Response#format`. (Luca Guidi in #281)
|
|
422
|
+
- Introduced `Hanami::Action#format` as factory to assign response format: `res.format = format(:json)` or `res.format = format("application/json")`. (Luca Guidi in #281)
|
|
423
|
+
- Removed `Hanami::Action#format=` in favor of `Hanami::Action::Response#format=`. (Luca Guidi in #281)
|
|
424
|
+
- `Hanami::Action.accept` now looks at request `Content-Type` header to accept/deny a request. (Gustavo Caso in #281)
|
|
425
|
+
- Removed `Hanami::Action#request_id` in favor of `Hanami::Action::Request#id`. (Luca Guidi in #281)
|
|
426
|
+
- Removed `Hanami::Action#parsed_request_body` in favor of `Hanami::Action::Request#parsed_body`. (Gustavo Caso in #281)
|
|
427
|
+
- Removed `Hanami::Action#head?` in favor of `Hanami::Action::Request#head?`. (Luca Guidi in #281)
|
|
428
|
+
- Removed `Hanami::Action#status` in favor of `Hanami::Action::Response#status=` and `#body=`. (Luca Guidi in #281)
|
|
429
|
+
- Removed `Hanami::Action#session` in favor of `Hanami::Action::Response#session`. (Luca Guidi in #281)
|
|
430
|
+
- Removed `Hanami::Action#cookies` in favor of `Hanami::Action::Response#cookies`. (Luca Guidi in #281)
|
|
431
|
+
- Removed `Hanami::Action#flash` in favor of `Hanami::Action::Response#flash`. (Luca Guidi in #281)
|
|
432
|
+
- Removed `Hanami::Action#redirect_to` in favor of `Hanami::Action::Response#redirect_to`. (Luca Guidi in #281)
|
|
433
|
+
- Removed `Hanami::Action#cache_control`, `#expires`, and `#fresh` in favor of `Hanami::Action::Response#cache_control`, `#expires`, and `#fresh`, respectively. (Luca Guidi in #281)
|
|
434
|
+
- Removed `Hanami::Action#send_file` and `#unsafe_send_file` in favor of `Hanami::Action::Response#send_file` and `#unsafe_send_file`, respectively. (Luca Guidi in #281)
|
|
435
|
+
- Removed `Hanami::Action#errors`. (Luca Guidi in #281)
|
|
436
|
+
- Removed body cleanup for `HEAD` requests. (Gustavo Caso in #281)
|
|
437
|
+
- `Hanami::Action` callback hooks now accept `Hanami::Action::Request` and `Hanami::Action::Response` arguments. (Luca Guidi in #281)
|
|
438
|
+
- When an exception is raised, it won't be caught, unless it's handled. (Luca Guidi in #281)
|
|
439
|
+
- `Hanami::Action` exception handlers now accept `Hanami::Action::Request`, `Hanami::Action::Response`, and exception arguments. (Luca Guidi in #281)
|
|
440
|
+
|
|
441
|
+
[2.0.0.alpha1]: https://github.com/hanami/hanami-controller/compare/v1.3.3...v2.0.0.alpha1
|
|
442
|
+
|
|
443
|
+
## [1.3.3] - 2020-01-14
|
|
444
|
+
|
|
445
|
+
### Added
|
|
446
|
+
|
|
447
|
+
- Official support for Ruby: MRI 2.7. (Luca Guidi in #323)
|
|
448
|
+
- Support `rack` 2.1. (Luca Guidi in #323)
|
|
449
|
+
- Support for both `hanami-validations` 1 and 2. (Luca Guidi in #323)
|
|
450
|
+
|
|
451
|
+
[1.3.3]: https://github.com/hanami/hanami-controller/compare/v1.3.2...v1.3.3
|
|
452
|
+
|
|
453
|
+
## [1.3.2] - 2019-06-28
|
|
389
454
|
|
|
390
455
|
### Fixed
|
|
391
456
|
|
|
392
|
-
-
|
|
457
|
+
- Ensure `Etag` to work when `If-Modified-Since` is sent from browser and upstream proxy sets `Last-Modified` automatically. (Ian Ker-Seymer in #321)
|
|
393
458
|
|
|
394
|
-
|
|
459
|
+
[1.3.2]: https://github.com/hanami/hanami-controller/compare/v1.3.1...v1.3.2
|
|
460
|
+
|
|
461
|
+
## [1.3.1] - 2019-01-18
|
|
395
462
|
|
|
396
463
|
### Added
|
|
397
464
|
|
|
398
|
-
-
|
|
399
|
-
-
|
|
465
|
+
- Official support for Ruby: MRI 2.6. (Luca Guidi in #317)
|
|
466
|
+
- Support `bundler` 2.0+. (Luca Guidi in #317)
|
|
467
|
+
|
|
468
|
+
[1.3.1]: https://github.com/hanami/hanami-controller/compare/v1.3.0...v1.3.1
|
|
400
469
|
|
|
401
|
-
##
|
|
470
|
+
## [1.3.0] - 2018-10-24
|
|
402
471
|
|
|
403
472
|
### Added
|
|
404
473
|
|
|
405
|
-
-
|
|
474
|
+
- Swappable JSON backed for `Hanami::Action::Flash` based on `Hanami::Utils::Json`. (Gustavo Caso in #306)
|
|
406
475
|
|
|
407
|
-
|
|
476
|
+
[1.3.0]: https://github.com/hanami/hanami-controller/compare/v1.3.0.beta1...v1.3.0
|
|
477
|
+
|
|
478
|
+
## [1.3.0.beta1] - 2018-08-08
|
|
408
479
|
|
|
409
480
|
### Added
|
|
410
481
|
|
|
411
|
-
-
|
|
482
|
+
- Official support for JRuby 9.2.0.0. (Luca Guidi in #303)
|
|
483
|
+
|
|
484
|
+
### Changed
|
|
485
|
+
|
|
486
|
+
- Deprecate `Hanami::Action#parsed_request_body`. (Gustavo Caso in #302)
|
|
412
487
|
|
|
413
488
|
### Fixed
|
|
414
489
|
|
|
415
|
-
-
|
|
416
|
-
-
|
|
417
|
-
-
|
|
490
|
+
- Ensure that if `If-None-Match` or `If-Modified-Since` response HTTP headers are missing, `Etag` or `Last-Modified` headers will be in response HTTP headers. (Yuji Ueki in #299)
|
|
491
|
+
- Don't show flash message for the request after a HTTP redirect. (Gustavo Caso in #301)
|
|
492
|
+
- Ensure `Hanami::Action::Flash#each`, `#map`, and `#empty?` to not reference stale flash data. (Gustavo Caso in #301)
|
|
418
493
|
|
|
419
|
-
|
|
494
|
+
[1.3.0.beta1]: https://github.com/hanami/hanami-controller/compare/v1.2.0...v1.3.0.beta1
|
|
420
495
|
|
|
421
|
-
|
|
496
|
+
## [1.2.0] - 2018-04-11
|
|
422
497
|
|
|
423
|
-
|
|
498
|
+
[1.2.0]: https://github.com/hanami/hanami-controller/compare/v1.2.0.rc2...v1.2.0
|
|
424
499
|
|
|
425
|
-
##
|
|
500
|
+
## [1.2.0.rc2] - 2018-04-06
|
|
426
501
|
|
|
427
502
|
### Added
|
|
428
503
|
|
|
429
|
-
-
|
|
504
|
+
- Introduce `Hanami::Action::Flash#each` and `#map`. (Gustavo Caso in #294)
|
|
430
505
|
|
|
431
|
-
|
|
506
|
+
[1.2.0.rc2]: https://github.com/hanami/hanami-controller/compare/v1.2.0.rc1...v1.2.0.rc2
|
|
432
507
|
|
|
433
|
-
##
|
|
508
|
+
## [1.2.0.rc1] - 2018-03-30
|
|
434
509
|
|
|
435
|
-
|
|
510
|
+
[1.2.0.rc1]: https://github.com/hanami/hanami-controller/compare/v1.2.0.beta2...v1.2.0.rc1
|
|
511
|
+
|
|
512
|
+
## [1.2.0.beta2] - 2018-03-23
|
|
513
|
+
|
|
514
|
+
[1.2.0.beta2]: https://github.com/hanami/hanami-controller/compare/v1.2.0.beta1...v1.2.0.beta2
|
|
515
|
+
|
|
516
|
+
## [1.2.0.beta1] - 2018-02-28
|
|
436
517
|
|
|
437
518
|
### Added
|
|
438
519
|
|
|
439
|
-
-
|
|
440
|
-
-
|
|
520
|
+
- Official support for Ruby: MRI 2.5. (Luca Guidi in #290)
|
|
521
|
+
- Introduce `Hanami::Action.content_type` to accept/reject requests according to their `Content-Type` header. (Sergey Fedorov in #207)
|
|
441
522
|
|
|
442
523
|
### Fixed
|
|
443
524
|
|
|
444
|
-
-
|
|
525
|
+
- Raise meaningful exception when trying to access `session` or `flash` and `Hanami::Action::Session` wasn't included. (wheresmyjetpack in #207)
|
|
526
|
+
|
|
527
|
+
[1.2.0.beta1]: https://github.com/hanami/hanami-controller/compare/v1.1.1...v1.2.0.beta1
|
|
445
528
|
|
|
446
|
-
##
|
|
529
|
+
## [1.1.1] - 2017-11-22
|
|
447
530
|
|
|
448
531
|
### Fixed
|
|
449
532
|
|
|
450
|
-
-
|
|
451
|
-
-
|
|
533
|
+
- Ensure `Hanami::Action#send_file` and `#unsafe_send_file` to run `after` action callbacks. (Luca Guidi in #282)
|
|
534
|
+
- Ensure Rack env to have the `REQUEST_METHOD` key set to `GET` during actions unit tests. (Luca Guidi in #282)
|
|
452
535
|
|
|
453
|
-
|
|
536
|
+
[1.1.1]: https://github.com/hanami/hanami-controller/compare/v1.1.0...v1.1.1
|
|
537
|
+
|
|
538
|
+
## [1.1.0] - 2017-10-25
|
|
454
539
|
|
|
455
540
|
### Added
|
|
456
541
|
|
|
457
|
-
-
|
|
542
|
+
- Introduce `Hanami::Action::CookieJar#each` to iterate through action's `cookies`. (Luca Guidi in #279)
|
|
543
|
+
|
|
544
|
+
[1.1.0]: https://github.com/hanami/hanami-controller/compare/v1.1.0.rc1...v1.1.0
|
|
545
|
+
|
|
546
|
+
## [1.1.0.rc1] - 2017-10-16
|
|
458
547
|
|
|
459
|
-
|
|
548
|
+
[1.1.0.rc1]: https://github.com/hanami/hanami-controller/compare/v1.1.0.beta3...v1.1.0.rc1
|
|
460
549
|
|
|
461
|
-
##
|
|
550
|
+
## [1.1.0.beta3] - 2017-10-04
|
|
462
551
|
|
|
463
|
-
|
|
552
|
+
[1.1.0.beta3]: https://github.com/hanami/hanami-controller/compare/v1.1.0.beta2...v1.1.0.beta3
|
|
553
|
+
|
|
554
|
+
## [1.1.0.beta2] - 2017-10-03
|
|
464
555
|
|
|
465
556
|
### Added
|
|
466
557
|
|
|
467
|
-
-
|
|
558
|
+
- Introduce `Hanami::Action::Params::Errors#add` to add errors not generated by params validations. (Luca Guidi in #276)
|
|
559
|
+
|
|
560
|
+
[1.1.0.beta2]: https://github.com/hanami/hanami-controller/compare/v1.1.0.beta1...v1.1.0.beta2
|
|
468
561
|
|
|
469
|
-
##
|
|
562
|
+
## [1.1.0.beta1] - 2017-08-11
|
|
470
563
|
|
|
471
|
-
|
|
564
|
+
[1.1.0.beta1]: https://github.com/hanami/hanami-controller/compare/v1.0.1...v1.1.0.beta1
|
|
565
|
+
|
|
566
|
+
## [1.0.1] - 2017-07-10
|
|
472
567
|
|
|
473
568
|
### Fixed
|
|
474
569
|
|
|
475
|
-
-
|
|
476
|
-
-
|
|
570
|
+
- Ensure validation params to be symbolized in all the environments. (Marcello Rocha in #269)
|
|
571
|
+
- Fix regression (`1.0.0`) about MIME type priority, during the evaluation of a weighted `Accept` HTTP header. (Marcello Rocha in #269)
|
|
572
|
+
|
|
573
|
+
[1.0.1]: https://github.com/hanami/hanami-controller/compare/v1.0.0...v1.0.1
|
|
477
574
|
|
|
478
|
-
##
|
|
575
|
+
## [1.0.0] - 2017-04-06
|
|
479
576
|
|
|
480
|
-
|
|
577
|
+
[1.0.0]: https://github.com/hanami/hanami-controller/compare/v1.0.0.rc1...v1.0.0
|
|
481
578
|
|
|
482
|
-
##
|
|
579
|
+
## [1.0.0.rc1] - 2017-03-31
|
|
580
|
+
|
|
581
|
+
[1.0.0.rc1]: https://github.com/hanami/hanami-controller/compare/v1.0.0.beta3...v1.0.0.rc1
|
|
582
|
+
|
|
583
|
+
## [1.0.0.beta3] - 2017-03-17
|
|
483
584
|
|
|
484
585
|
### Changed
|
|
485
586
|
|
|
486
|
-
-
|
|
587
|
+
- `Action#flash` is now public API. (Luca Guidi in #262)
|
|
588
|
+
|
|
589
|
+
[1.0.0.beta3]: https://github.com/hanami/hanami-controller/compare/v1.0.0.beta2...v1.0.0.beta3
|
|
487
590
|
|
|
488
|
-
##
|
|
591
|
+
## [1.0.0.beta2] - 2017-03-02
|
|
489
592
|
|
|
490
593
|
### Added
|
|
491
594
|
|
|
492
|
-
-
|
|
595
|
+
- Add `Action#unsafe_send_file` to send files outside of the public directory of a project. (Marcello Rocha in #257)
|
|
493
596
|
|
|
494
597
|
### Fixed
|
|
495
598
|
|
|
496
|
-
-
|
|
497
|
-
-
|
|
498
|
-
-
|
|
499
|
-
-
|
|
599
|
+
- Ensure HTTP Cache to not crash when `HTTP_IF_MODIFIED_SINCE` and `HTTP_IF_NONE_MATCH` have blank values. (Anton Davydov in #253)
|
|
600
|
+
- Keep flash values after a redirect. (Luca Guidi in #259)
|
|
601
|
+
- Ensure to return 404 when `Action#send_file` cannot find a file with a globbed route. (Craig M. Wellington & Luca Guidi in #260)
|
|
602
|
+
- Don't mutate Rack env when sending files. (Luca Guidi in #260)
|
|
500
603
|
|
|
501
|
-
|
|
604
|
+
[1.0.0.beta2]: https://github.com/hanami/hanami-controller/compare/v1.0.0.beta1...v1.0.0.beta2
|
|
605
|
+
|
|
606
|
+
## [1.0.0.beta1] - 2017-02-14
|
|
502
607
|
|
|
503
608
|
### Added
|
|
504
609
|
|
|
505
|
-
-
|
|
610
|
+
- Official support for Ruby: MRI 2.4. (Luca Guidi in #236)
|
|
611
|
+
|
|
612
|
+
### Changed
|
|
613
|
+
|
|
614
|
+
- Make it work only with Rack 2.0. (Anton Davydov & Luca Guidi in #239)
|
|
506
615
|
|
|
507
616
|
### Fixed
|
|
508
617
|
|
|
509
|
-
-
|
|
510
|
-
-
|
|
511
|
-
-
|
|
618
|
+
- Avoid MIME type conflicts for `Action#format` detection. (Marcello Rocha & Luca Guidi in #255)
|
|
619
|
+
- Ensure `Flash` to return only fresh data. (Matias H. Leidemer & Luca Guidi in #jardakotesovec)
|
|
620
|
+
- Ensure `session` keys to be accessed as symbols in action unit tests. (Luca Guidi in #237)
|
|
512
621
|
|
|
513
|
-
|
|
622
|
+
[1.0.0.beta1]: https://github.com/hanami/hanami-controller/compare/v0.8.1...v1.0.0.beta1
|
|
623
|
+
|
|
624
|
+
## [0.8.1] - 2016-12-19
|
|
514
625
|
|
|
515
|
-
|
|
626
|
+
### Added
|
|
516
627
|
|
|
517
|
-
|
|
628
|
+
- Add `flash` to the default exposures. (Luca Guidi in #233)
|
|
518
629
|
|
|
519
630
|
### Fixed
|
|
520
631
|
|
|
521
|
-
-
|
|
522
|
-
- [Luca Guidi] Add `flash` to the default exposures
|
|
632
|
+
- Don't pollute Rack env's `rack.exception` key if an exception is handled. (Thorbjørn Hermansen in #234)
|
|
523
633
|
|
|
524
|
-
|
|
634
|
+
[0.8.1]: https://github.com/hanami/hanami-controller/compare/v0.8.0...v0.8.1
|
|
635
|
+
|
|
636
|
+
## [0.8.0] - 2016-11-15
|
|
525
637
|
|
|
526
638
|
### Added
|
|
527
639
|
|
|
528
|
-
-
|
|
640
|
+
- Allow `BaseParams#get` to read (nested) arrays. (Marion Duprey in #227)
|
|
529
641
|
|
|
530
|
-
###
|
|
642
|
+
### Changed
|
|
531
643
|
|
|
532
|
-
-
|
|
533
|
-
- [Kyle Chong] Don't symbolize raw params
|
|
644
|
+
- Let `BaseParams#get` to accept a list of keys (symbols) instead of string with dot notation (`params.get(:customer, :address, :city)` instead of `params.get('customer.address.city')`). (Luca Guidi in #229)
|
|
534
645
|
|
|
535
|
-
###
|
|
646
|
+
### Fixed
|
|
647
|
+
|
|
648
|
+
- Respect custom formats when referenced by HTTP `Accept`. (Russell Cloak in #221)
|
|
649
|
+
- Don't symbolize raw params. (Kyle Chong in #224)
|
|
536
650
|
|
|
537
|
-
|
|
651
|
+
[0.8.0]: https://github.com/hanami/hanami-controller/compare/v0.7.1...v0.8.0
|
|
538
652
|
|
|
539
|
-
##
|
|
653
|
+
## [0.7.1] - 2016-10-06
|
|
540
654
|
|
|
541
655
|
### Added
|
|
542
656
|
|
|
543
|
-
-
|
|
544
|
-
-
|
|
657
|
+
- Introduced `parsed_request_body` for action. (Kyle Chong in #155)
|
|
658
|
+
- Introduced `Hanami::Action::BaseParams#each`. (Luca Guidi in #176)
|
|
545
659
|
|
|
546
|
-
###
|
|
660
|
+
### Changed
|
|
547
661
|
|
|
548
|
-
-
|
|
549
|
-
- [Kyle Chong] Don't stringify uploaded files
|
|
550
|
-
- [Kyle Chong] Don't stringify params values when not necessary
|
|
662
|
+
- Raise `Hanami::Controller::IllegalExposureError` when try to expose reserved words: `params`, and `flash`. (akhramov & Luca Guidi in #195)
|
|
551
663
|
|
|
552
|
-
###
|
|
664
|
+
### Fixed
|
|
665
|
+
|
|
666
|
+
- Use default content type when `HTTP_ACCEPT` is `*/*`. (Ayleen McCann in #211)
|
|
667
|
+
- Don't stringify uploaded files. (Kyle Chong in #213)
|
|
668
|
+
- Don't stringify params values when not necessary. (Kyle Chong in #214)
|
|
553
669
|
|
|
554
|
-
|
|
670
|
+
[0.7.1]: https://github.com/hanami/hanami-controller/compare/v0.7.0...v0.7.1
|
|
555
671
|
|
|
556
|
-
##
|
|
672
|
+
## [0.7.0] - 2016-07-22
|
|
557
673
|
|
|
558
674
|
### Added
|
|
559
675
|
|
|
560
|
-
-
|
|
676
|
+
- Introduced `Hanami::Action::Params#error_messages` which returns a flat collection of full error messages. (Luca Guidi in #165)
|
|
677
|
+
- Nested params validation. (Steve Hodgkiss in #168)
|
|
561
678
|
|
|
562
|
-
###
|
|
679
|
+
### Changed
|
|
563
680
|
|
|
564
|
-
-
|
|
565
|
-
-
|
|
681
|
+
- Drop support for Ruby 2.0 and 2.1. Official support for JRuby 9.0.5.0+. (Luca Guidi in #verbman)
|
|
682
|
+
- Param validations now require you to add `hanami-validations` in `Gemfile`. (Luca Guidi in #verbman)
|
|
683
|
+
- Removed "_indifferent access_" for params. Since now on, only symbols are allowed. (Luca Guidi in #verbman)
|
|
684
|
+
- Params are immutable. (Luca Guidi in #verbman)
|
|
685
|
+
- Params validations syntax has changed. (Luca Guidi in #verbman)
|
|
686
|
+
- `Hanami::Action::Params#errors` now returns a Hash. Keys are symbols representing invalid params, while values are arrays of strings with a message of the failure. (Luca Guidi in #verbman)
|
|
687
|
+
- Made `Hanami::Action::Session#errors` public. (Vasilis Spilka in #171)
|
|
566
688
|
|
|
567
|
-
###
|
|
689
|
+
### Fixed
|
|
690
|
+
|
|
691
|
+
- Params are deeply symbolized. (Luca Guidi in #verbman)
|
|
692
|
+
- Send only changed cookies in HTTP response. (Artem Nistratov in #153)
|
|
568
693
|
|
|
569
|
-
|
|
570
|
-
- [Luca Guidi] Param validations now require you to add `hanami-validations` in `Gemfile`.
|
|
571
|
-
- [Luca Guidi] Removed "_indifferent access_" for params. Since now on, only symbols are allowed.
|
|
572
|
-
- [Luca Guidi] Params are immutable
|
|
573
|
-
- [Luca Guidi] Params validations syntax has changed
|
|
574
|
-
- [Luca Guidi] `Hanami::Action::Params#errors` now returns a Hash. Keys are symbols representing invalid params, while values are arrays of strings with a message of the failure.
|
|
575
|
-
- [Vasilis Spilka] Made `Hanami::Action::Session#errors` public
|
|
694
|
+
[0.7.0]: https://github.com/hanami/hanami-controller/compare/v0.6.1...v0.7.0
|
|
576
695
|
|
|
577
|
-
##
|
|
696
|
+
## [0.6.1] - 2016-02-05
|
|
578
697
|
|
|
579
698
|
### Changed
|
|
580
699
|
|
|
581
|
-
-
|
|
700
|
+
- Optimise memory usage by freezing MIME types constant. (Anatolii Didukh in #152)
|
|
582
701
|
|
|
583
|
-
|
|
702
|
+
[0.6.1]: https://github.com/hanami/hanami-controller/compare/v0.6.0...v0.6.1
|
|
703
|
+
|
|
704
|
+
## [0.6.0] - 2016-01-22
|
|
584
705
|
|
|
585
706
|
### Changed
|
|
586
707
|
|
|
587
|
-
-
|
|
708
|
+
- Renamed the project. (Luca Guidi)
|
|
709
|
+
|
|
710
|
+
[0.6.0]: https://github.com/hanami/hanami-controller/compare/v0.5.1...v0.6.0
|
|
588
711
|
|
|
589
|
-
##
|
|
712
|
+
## [0.5.1] - 2016-01-19
|
|
590
713
|
|
|
591
714
|
### Fixed
|
|
592
715
|
|
|
593
|
-
-
|
|
716
|
+
- Ensure `rack.session` cookie to not be sent twice when both `Lotus::Action::Cookies` and `Rack::Session::Cookie` are used together. (Alfonso Uceda in #148)
|
|
594
717
|
|
|
595
|
-
|
|
718
|
+
[0.5.1]: https://github.com/hanami/hanami-controller/compare/v0.5.0...v0.5.1
|
|
719
|
+
|
|
720
|
+
## [0.5.0] - 2016-01-12
|
|
596
721
|
|
|
597
722
|
### Added
|
|
598
723
|
|
|
599
|
-
-
|
|
724
|
+
- Reference a raised exception in Rack env's `rack.exception`. Compatibility with exception reporting SaaS. (Luca Guidi in #129)
|
|
600
725
|
|
|
601
|
-
###
|
|
726
|
+
### Changed
|
|
602
727
|
|
|
603
|
-
-
|
|
604
|
-
-
|
|
728
|
+
- Removed `Lotus::Controller::Configuration#default_format`. (Luca Guidi)
|
|
729
|
+
- Made `Lotus::Action#session` a public method for improved unit testing. (Cainã Costa in #135)
|
|
730
|
+
- Introduced `Lotus::Controller::Error` and let all the framework exceptions to inherit from it. (Karim Tarek in #147)
|
|
605
731
|
|
|
606
|
-
###
|
|
732
|
+
### Fixed
|
|
607
733
|
|
|
608
|
-
-
|
|
609
|
-
-
|
|
610
|
-
- [Karim Tarek] Introduced `Lotus::Controller::Error` and let all the framework exceptions to inherit from it.
|
|
734
|
+
- Ensure superclass exceptions to not shadow subclasses during exception handling (eg. `CustomError` handler will take precedence over `StandardError`). (Luca Guidi)
|
|
735
|
+
- Ensure Rack environment to be always available for sessions unit tests. (Cainã Costa in #135)
|
|
611
736
|
|
|
612
|
-
|
|
737
|
+
[0.5.0]: https://github.com/hanami/hanami-controller/compare/v0.4.6...v0.5.0
|
|
738
|
+
|
|
739
|
+
## [0.4.6] - 2015-12-04
|
|
613
740
|
|
|
614
741
|
### Added
|
|
615
742
|
|
|
616
|
-
-
|
|
743
|
+
- Allow to force custom headers for responses that according to RFC shouldn't include them (eg 204). Override `#keep_response_header?(header)` in action. (Luca Guidi in #124)
|
|
744
|
+
|
|
745
|
+
[0.4.6]: https://github.com/hanami/hanami-controller/compare/v0.4.5...v0.4.6
|
|
617
746
|
|
|
618
|
-
##
|
|
747
|
+
## [0.4.5] - 2015-09-30
|
|
619
748
|
|
|
620
749
|
### Added
|
|
621
750
|
|
|
622
|
-
-
|
|
623
|
-
-
|
|
751
|
+
- Added configuration entries: `#default_request_format` and `default_response_format`. (Theo Felippe in #122)
|
|
752
|
+
- Error handling to take account of inherited exceptions. (Wellington Santos in #127)
|
|
624
753
|
|
|
625
|
-
###
|
|
754
|
+
### Deprecated
|
|
755
|
+
|
|
756
|
+
- Deprecate `#default_format` in favor of: `#default_request_format`. (Theo Felippe in #122)
|
|
626
757
|
|
|
627
|
-
|
|
758
|
+
[0.4.5]: https://github.com/hanami/hanami-controller/compare/v0.4.4...v0.4.5
|
|
628
759
|
|
|
629
|
-
##
|
|
760
|
+
## [0.4.4] - 2015-06-23
|
|
630
761
|
|
|
631
762
|
### Added
|
|
632
763
|
|
|
633
|
-
-
|
|
764
|
+
- Security protection against Cross Site Request Forgery (CSRF). (Luca Guidi in #118)
|
|
634
765
|
|
|
635
766
|
### Fixed
|
|
636
767
|
|
|
637
|
-
-
|
|
768
|
+
- Ensure nested params to be correctly coerced to Hash. (Matthew Bellantoni in #107)
|
|
638
769
|
|
|
639
|
-
|
|
770
|
+
[0.4.4]: https://github.com/hanami/hanami-controller/compare/v0.4.3...v0.4.4
|
|
771
|
+
|
|
772
|
+
## [0.4.3] - 2015-05-22
|
|
640
773
|
|
|
641
774
|
### Added
|
|
642
775
|
|
|
643
|
-
-
|
|
644
|
-
-
|
|
776
|
+
- Introduced `Lotus::Action#send_file`. (Alfonso Uceda Pompa in #105)
|
|
777
|
+
- Set automatically `Expires` option for cookies when it's missing but `Max-Age` is present. Compatibility with old browsers. (Alfonso Uceda Pompa in #102)
|
|
645
778
|
|
|
646
|
-
|
|
779
|
+
[0.4.3]: https://github.com/hanami/hanami-controller/compare/v0.4.2...v0.4.3
|
|
647
780
|
|
|
648
|
-
|
|
781
|
+
## [0.4.2] - 2015-05-15
|
|
649
782
|
|
|
650
|
-
|
|
783
|
+
### Fixed
|
|
651
784
|
|
|
652
|
-
|
|
785
|
+
- Ensure `Lotus::Action::Params#to_h` to return `::Hash` at the top level. (Luca Guidi in #101)
|
|
653
786
|
|
|
654
|
-
|
|
787
|
+
[0.4.2]: https://github.com/hanami/hanami-controller/compare/v0.4.1...v0.4.2
|
|
655
788
|
|
|
656
|
-
|
|
657
|
-
- [Luca Guidi] Ensure `Lotus::Action#redirect_to` to return `::String` for Rack servers compatibility.
|
|
789
|
+
## [0.4.1] - 2015-05-15
|
|
658
790
|
|
|
659
791
|
### Changed
|
|
660
792
|
|
|
661
|
-
-
|
|
662
|
-
|
|
663
|
-
|
|
793
|
+
- Prevent `Content-Type` and `Content-Lenght` to be sent when status code requires no body (eg. `204`). This is for compatibility with `Rack::Lint`, not with RFC 2016. (Alfonso Uceda Pompa in #99)
|
|
794
|
+
- Ensure `Lotus::Action::Params#to_h` to return `::Hash`. (Luca Guidi in #96)
|
|
795
|
+
|
|
796
|
+
### Fixed
|
|
797
|
+
|
|
798
|
+
- Ensure proper automatic `Content-Type` working well with Internet Explorer. (Luca Guidi in #94)
|
|
799
|
+
- Ensure `Lotus::Action#redirect_to` to return `::String` for Rack servers compatibility. (Luca Guidi in #95)
|
|
664
800
|
|
|
665
|
-
|
|
801
|
+
[0.4.1]: https://github.com/hanami/hanami-controller/compare/v0.4.0...v0.4.1
|
|
802
|
+
|
|
803
|
+
## [0.4.0] - 2015-03-23
|
|
666
804
|
|
|
667
805
|
### Added
|
|
668
806
|
|
|
669
|
-
-
|
|
670
|
-
-
|
|
671
|
-
-
|
|
672
|
-
-
|
|
807
|
+
- `Action.use` now accepts a block. (Erol Fornoles in #70)
|
|
808
|
+
- Introduced `Lotus::Controller::Configuration#cookies` as default cookie options. (Alfonso Uceda Pompa in #77)
|
|
809
|
+
- Introduced `Lotus::Controller::Configuration#default_headers` as default HTTP headers to return in all the responses. (Alfonso Uceda Pompa in #82)
|
|
810
|
+
- Introduced `Lotus::Action::Params#get` as a safe API to access nested params. (Luca Guidi in #89)
|
|
673
811
|
|
|
674
812
|
### Changed
|
|
675
813
|
|
|
676
|
-
-
|
|
814
|
+
- `redirect_to` now is a flow control method: it terminates the execution of an action, including the callbacks. (Alfonso Uceda Pompa in #73)
|
|
815
|
+
|
|
816
|
+
[0.4.0]: https://github.com/hanami/hanami-controller/compare/v0.3.2...v0.4.0
|
|
677
817
|
|
|
678
|
-
##
|
|
818
|
+
## [0.3.2] - 2015-01-30
|
|
679
819
|
|
|
680
820
|
### Added
|
|
681
821
|
|
|
682
|
-
-
|
|
683
|
-
-
|
|
684
|
-
-
|
|
685
|
-
-
|
|
686
|
-
-
|
|
822
|
+
- Callbacks: introduced `append_before` (alias of `before`), `append_after` (alias of `after`), `prepend_before` and `prepend_after`. (Alfonso Uceda Pompa in #65)
|
|
823
|
+
- Introduced `Lotus::Action::Params#raw` which returns unfiltered data as it comes from an HTTP request. (Alfonso Uceda Pompa in #69)
|
|
824
|
+
- `Lotus::Action::Rack.use` now fully supports Rack middleware, by mounting an internal `Rack::Builder` instance. (Alfonso Uceda Pompa in #66)
|
|
825
|
+
- Introduced `Lotus::Action::Throwable#halt` now accepts an optional message. If missing it falls back to the corresponding HTTP status message. (Simone Carletti in #67)
|
|
826
|
+
- Nested params validation. (Steve Hodgkiss in #50)
|
|
687
827
|
|
|
688
828
|
### Fixed
|
|
689
829
|
|
|
690
|
-
-
|
|
691
|
-
-
|
|
692
|
-
-
|
|
693
|
-
-
|
|
830
|
+
- Ensure HEAD requests will return empty body. (Luca Guidi in #57)
|
|
831
|
+
- Ensure HTTP status codes with empty body won't send body and non-entity headers. (Stefano Verna in #18)
|
|
832
|
+
- Only dump exceptions in `rack.errors` if handling is turned off, or the raised exception is not managed. (Luca Guidi in #58)
|
|
833
|
+
- Ensure params will return coerced values. (Luca Guidi in #58)
|
|
694
834
|
|
|
695
|
-
|
|
835
|
+
[0.3.2]: https://github.com/hanami/hanami-controller/compare/v0.3.1...v0.3.2
|
|
836
|
+
|
|
837
|
+
## [0.3.1] - 2015-01-08
|
|
696
838
|
|
|
697
839
|
### Added
|
|
698
840
|
|
|
699
|
-
-
|
|
841
|
+
- Introduced `Action#request` which returns an instance a `Rack::Request` compliant object: `Lotus::Action::Request`. (Lasse Skindstad Ebert in #48)
|
|
700
842
|
|
|
701
843
|
### Fixed
|
|
702
844
|
|
|
703
|
-
-
|
|
845
|
+
- Ensure params to return coerced values. (Steve Hodgkiss in #54)
|
|
846
|
+
|
|
847
|
+
[0.3.1]: https://github.com/hanami/hanami-controller/compare/v0.3.0...v0.3.1
|
|
704
848
|
|
|
705
|
-
##
|
|
849
|
+
## [0.3.0] - 2014-12-23
|
|
706
850
|
|
|
707
851
|
### Added
|
|
708
852
|
|
|
709
|
-
-
|
|
710
|
-
-
|
|
711
|
-
-
|
|
712
|
-
-
|
|
713
|
-
-
|
|
714
|
-
-
|
|
715
|
-
-
|
|
716
|
-
-
|
|
717
|
-
-
|
|
718
|
-
-
|
|
719
|
-
-
|
|
720
|
-
-
|
|
721
|
-
-
|
|
853
|
+
- Introduced `Action#request_id` as unique identifier for an incoming HTTP request. (Luca Guidi)
|
|
854
|
+
- Introduced `Lotus::Controller.load!` as loading framework entry point. (Luca Guidi)
|
|
855
|
+
- Allow to define a default charset (`default_charset` configuration). (Kir Shatrov in #45)
|
|
856
|
+
- Automatic content type with charset (eg `Content-Type: text/html; charset=utf-8`). (Kir Shatrov in #45)
|
|
857
|
+
- Allow to specify custom exception handlers: procs or methods (`exception_handler` configuration). (Michał Krzyżanowski in #44)
|
|
858
|
+
- Introduced HTTP caching (`Cache-Control`, `Last-Modified`, ETAG, Conditional GET, expires). (Karl Freeman & Lucas Souza in #43)
|
|
859
|
+
- Introduced `Action::Params#to_h` and `#to_hash`. (Satoshi Amemiya in #42)
|
|
860
|
+
- Added `#params` and `#errors` as default exposures. (Luca Guidi)
|
|
861
|
+
- Introduced complete params validations. (Luca Guidi)
|
|
862
|
+
- Allow to whitelist params. (Luca Guidi & Matthew Bellantoni in #38)
|
|
863
|
+
- Allow to define custom classes for params via `Action.params`. (Luca Guidi & Matthew Bellantoni in #38)
|
|
864
|
+
- Introduced `Action#format` as query method to introspect the requested mime type. (Krzysztof Zalewski in #37)
|
|
865
|
+
- Official support for Ruby 2.2. (Luca Guidi)
|
|
722
866
|
|
|
723
867
|
### Changed
|
|
724
868
|
|
|
725
|
-
-
|
|
726
|
-
-
|
|
727
|
-
-
|
|
728
|
-
-
|
|
729
|
-
-
|
|
730
|
-
-
|
|
869
|
+
- Renamed `Configuration#modules` to `#prepare`. (Trung Lê in #41)
|
|
870
|
+
- Update HTTP status codes to IETF RFC 7231. (Luca Guidi)
|
|
871
|
+
- When `Lotus::Controller` is included, don't inject code. (Luca Guidi)
|
|
872
|
+
- Removed `Controller.action` as a DSL to define actions. (Luca Guidi)
|
|
873
|
+
- Removed `Action#content_type` in favor of `#format=` which accepts a symbol (eg. `:json`). (Krzysztof Zalewski in #37)
|
|
874
|
+
- Reduce method visibility where possible (Ruby `private` and `protected`). (Fuad Saud in #17)
|
|
731
875
|
|
|
732
876
|
### Fixed
|
|
733
877
|
|
|
734
|
-
-
|
|
878
|
+
- Don't let exposures definition to override existing methods. (Luca Guidi in #40)
|
|
735
879
|
|
|
736
|
-
|
|
880
|
+
[0.3.0]: https://github.com/hanami/hanami-controller/compare/v0.2.0...v0.3.0
|
|
881
|
+
|
|
882
|
+
## [0.2.0] - 2014-06-23
|
|
737
883
|
|
|
738
884
|
### Added
|
|
739
885
|
|
|
740
|
-
-
|
|
741
|
-
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
-
|
|
745
|
-
-
|
|
746
|
-
-
|
|
747
|
-
-
|
|
886
|
+
- Introduced `Controller.configure` and `Controller.duplicate`. (Luca Guidi)
|
|
887
|
+
- Introduced `Action.use`, that let to use a Rack middleware as a before callback. (Luca Guidi)
|
|
888
|
+
- Allow to define a default mime type when the request is `Accept: */*` (`default_format` configuration). (Luca Guidi)
|
|
889
|
+
- Allow to register custom mime types and associate them to a symbol (`format` configuration). (Luca Guidi)
|
|
890
|
+
- Introduced `Configuration#handle_exceptions` to associate exceptions to HTTP statuses. (Luca Guidi)
|
|
891
|
+
- Allow developers to toggle exception handling (`handle_exceptions` configuration). (Damir Zekic in #23)
|
|
892
|
+
- Introduced `Controller::Configuration`. (Luca Guidi)
|
|
893
|
+
- Official support for Ruby 2.1. (Luca Guidi)
|
|
748
894
|
|
|
749
895
|
### Changed
|
|
750
896
|
|
|
751
|
-
-
|
|
752
|
-
-
|
|
753
|
-
-
|
|
754
|
-
-
|
|
897
|
+
- `Lotus::Action::Params` doesn't inherit from `Lotus::Utils::Hash` anymore. (Luca Guidi)
|
|
898
|
+
- `Lotus::Action::CookieJar` doesn't inherit from `Lotus::Utils::Hash` anymore. (Luca Guidi)
|
|
899
|
+
- Make HTTP status messages compliant with IANA and Rack. (Luca Guidi)
|
|
900
|
+
- Moved `#throw` override logic into `#halt`, which keeps the same semantic. (Damir Zekic in #28)
|
|
755
901
|
|
|
756
902
|
### Fixed
|
|
757
903
|
|
|
758
|
-
-
|
|
904
|
+
- Reference exception in `rack.errors`. (Krzysztof Zalewski in #26)
|
|
905
|
+
|
|
906
|
+
[0.2.0]: https://github.com/hanami/hanami-controller/compare/v0.1.0...v0.2.0
|
|
759
907
|
|
|
760
|
-
##
|
|
908
|
+
## [0.1.0] - 2014-02-23
|
|
761
909
|
|
|
762
910
|
### Added
|
|
763
911
|
|
|
764
|
-
-
|
|
765
|
-
-
|
|
766
|
-
-
|
|
767
|
-
-
|
|
768
|
-
-
|
|
769
|
-
-
|
|
770
|
-
-
|
|
771
|
-
-
|
|
772
|
-
-
|
|
773
|
-
-
|
|
774
|
-
-
|
|
775
|
-
-
|
|
776
|
-
-
|
|
912
|
+
- Introduced `Action.accept` to whitelist accepted mime types. (Luca Guidi)
|
|
913
|
+
- Introduced `Action#accept?` as a query method for the current request. (Luca Guidi)
|
|
914
|
+
- Allow to whitelist handled exceptions and associate them to an HTTP status. (Luca Guidi)
|
|
915
|
+
- Automatic `Content-Type`. (Luca Guidi)
|
|
916
|
+
- Use `throw` as a control flow which understands HTTP status. (Luca Guidi)
|
|
917
|
+
- Introduced opt-in support for HTTP/Rack cookies. (Luca Guidi)
|
|
918
|
+
- Introduced opt-in support for HTTP/Rack sessions. (Luca Guidi)
|
|
919
|
+
- Introduced HTTP redirect API. (Luca Guidi)
|
|
920
|
+
- Introduced callbacks for actions: before and after. (Luca Guidi)
|
|
921
|
+
- Introduced exceptions handling with HTTP statuses. (Luca Guidi)
|
|
922
|
+
- Introduced exposures. (Luca Guidi)
|
|
923
|
+
- Introduced basic actions compatible with Rack. (Luca Guidi)
|
|
924
|
+
- Official support for Ruby 2.0. (Luca Guidi)
|
|
925
|
+
|
|
926
|
+
[0.1.0]: https://github.com/hanami/hanami-controller/releases/tag/v0.1.0
|