hanami-controller 2.3.0 → 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 +523 -340
- data/LICENSE +20 -0
- data/README.md +13 -23
- data/hanami-controller.gemspec +25 -19
- data/lib/hanami/action/cache/conditional_get.rb +1 -1
- data/lib/hanami/action/config/formats.rb +1 -1
- data/lib/hanami/action/config.rb +5 -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 +5 -3
- data/lib/hanami/controller/version.rb +1 -1
- metadata +16 -85
- data/LICENSE.md +0 -22
data/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,52 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Changelog
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
-
|
|
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).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
### Deprecated
|
|
15
|
+
|
|
16
|
+
### Removed
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
### Security
|
|
21
|
+
|
|
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
|
|
31
|
+
|
|
32
|
+
## [2.3.1] - 2025-12-06
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
|
|
36
|
+
- Allow `handle_exception` to receive multiple class names as strings. (@sidane in #495)
|
|
37
|
+
|
|
38
|
+
```ruby
|
|
39
|
+
class MyAction < Hanami::Action
|
|
40
|
+
config.handle_exception(
|
|
41
|
+
"MyException" => 500,
|
|
42
|
+
"MyOtherException" => 501
|
|
43
|
+
)
|
|
44
|
+
end
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
[2.3.1]: https://github.com/hanami/hanami-controller/compare/v2.3.0...v2.3.1
|
|
48
|
+
|
|
49
|
+
## [2.3.0] - 2025-11-12
|
|
6
50
|
|
|
7
51
|
### Added
|
|
8
52
|
|
|
@@ -19,7 +63,7 @@ Complete, fast and testable actions for Rack
|
|
|
19
63
|
config.handle_exception "ROM::TupleCountMismatchError" => 404
|
|
20
64
|
end
|
|
21
65
|
```
|
|
22
|
-
- 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)
|
|
23
67
|
|
|
24
68
|
```ruby
|
|
25
69
|
def handle(request, response)
|
|
@@ -28,11 +72,13 @@ Complete, fast and testable actions for Rack
|
|
|
28
72
|
end
|
|
29
73
|
```
|
|
30
74
|
|
|
31
|
-
|
|
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
|
|
32
78
|
|
|
33
79
|
### Added
|
|
34
80
|
|
|
35
|
-
-
|
|
81
|
+
- Make format config more flexible. (Tim Riley in #485)
|
|
36
82
|
|
|
37
83
|
**Use `config.formats.register` to register a new format and its media types.**
|
|
38
84
|
|
|
@@ -98,646 +144,783 @@ Complete, fast and testable actions for Rack
|
|
|
98
144
|
|
|
99
145
|
### Changed
|
|
100
146
|
|
|
101
|
-
-
|
|
102
|
-
-
|
|
103
|
-
|
|
104
|
-
## v2.3.0.beta1 - 2025-10-03
|
|
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)
|
|
105
149
|
|
|
106
|
-
|
|
150
|
+
[2.3.0.beta2]: https://github.com/hanami/hanami-controller/compare/v2.3.0.beta1...v2.3.0.beta2
|
|
107
151
|
|
|
108
|
-
|
|
152
|
+
## [2.3.0.beta1] - 2025-10-03
|
|
109
153
|
|
|
110
154
|
### Added
|
|
111
155
|
|
|
112
|
-
-
|
|
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)
|
|
113
157
|
|
|
114
158
|
### Changed
|
|
115
159
|
|
|
116
|
-
-
|
|
117
|
-
-
|
|
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)
|
|
118
166
|
|
|
119
|
-
|
|
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
|
|
120
170
|
|
|
121
171
|
### Added
|
|
122
172
|
|
|
123
|
-
-
|
|
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
|
|
124
178
|
|
|
125
|
-
|
|
179
|
+
[2.2.0.rc1]: https://github.com/hanami/hanami-controller/compare/v2.2.0.beta2...v2.2.0.rc1
|
|
126
180
|
|
|
127
|
-
##
|
|
181
|
+
## [2.2.0.beta2] - 2024-09-25
|
|
128
182
|
|
|
129
183
|
### Added
|
|
130
184
|
|
|
131
|
-
-
|
|
185
|
+
- Add support for using full dry-validation contracts for action param validation, via `Hanami::Action.contract`. (Tim Riley, Krzysztof Piotrowski in #453, #454)
|
|
132
186
|
|
|
133
|
-
|
|
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
|
|
134
190
|
|
|
135
191
|
### Changed
|
|
136
192
|
|
|
137
|
-
- 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
|
|
138
196
|
|
|
139
|
-
##
|
|
197
|
+
## [2.1.0] - 2024-02-27
|
|
140
198
|
|
|
141
|
-
|
|
199
|
+
[2.1.0]: https://github.com/hanami/hanami-controller/compare/v2.1.0.rc3...v2.1.0
|
|
142
200
|
|
|
143
|
-
##
|
|
201
|
+
## [2.1.0.rc3] - 2024-02-16
|
|
144
202
|
|
|
145
|
-
|
|
203
|
+
[2.1.0.rc3]: https://github.com/hanami/hanami-controller/compare/v2.1.0.rc2...v2.1.0.rc3
|
|
204
|
+
|
|
205
|
+
## [2.1.0.rc2] - 2023-11-08
|
|
206
|
+
|
|
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
|
|
146
210
|
|
|
147
211
|
### Fixed
|
|
148
212
|
|
|
149
|
-
-
|
|
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
|
|
150
216
|
|
|
151
|
-
##
|
|
217
|
+
## [2.1.0.beta2] - 2023-10-04
|
|
152
218
|
|
|
153
219
|
### Fixed
|
|
154
220
|
|
|
155
|
-
-
|
|
221
|
+
- `Hanami::Action::Config#root`: don't check realpath existence to simplify the boot process of Hanami. (Luca Guidi in #429)
|
|
156
222
|
|
|
157
|
-
|
|
223
|
+
[2.1.0.beta2]: https://github.com/hanami/hanami-controller/compare/v2.1.0.beta1...v2.1.0.beta2
|
|
224
|
+
|
|
225
|
+
## [2.1.0.beta1] - 2023-06-29
|
|
158
226
|
|
|
159
227
|
### Added
|
|
160
228
|
|
|
161
|
-
-
|
|
229
|
+
- Add `Request#session_enabled?` and `Response#session_enabled?`. (Tim Riley in #423)
|
|
230
|
+
|
|
231
|
+
[2.1.0.beta1]: https://github.com/hanami/hanami-controller/compare/v2.0.2...v2.1.0.beta1
|
|
162
232
|
|
|
163
|
-
##
|
|
233
|
+
## [2.0.2] - 2023-02-01
|
|
164
234
|
|
|
165
235
|
### Added
|
|
166
236
|
|
|
167
|
-
-
|
|
168
|
-
-
|
|
169
|
-
-
|
|
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)
|
|
170
240
|
|
|
171
241
|
### Fixed
|
|
172
242
|
|
|
173
|
-
-
|
|
174
|
-
-
|
|
175
|
-
-
|
|
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)
|
|
176
246
|
|
|
177
|
-
|
|
247
|
+
[2.0.2]: https://github.com/hanami/hanami-controller/compare/v2.0.1...v2.0.2
|
|
248
|
+
|
|
249
|
+
## [2.0.1] - 2022-12-25
|
|
178
250
|
|
|
179
251
|
### Added
|
|
180
252
|
|
|
181
|
-
-
|
|
253
|
+
- Official support for Ruby 3.2. (Luca Guidi in #408)
|
|
254
|
+
|
|
255
|
+
[2.0.1]: https://github.com/hanami/hanami-controller/compare/v2.0.0...v2.0.1
|
|
182
256
|
|
|
183
|
-
##
|
|
257
|
+
## [2.0.0] - 2022-11-22
|
|
184
258
|
|
|
185
259
|
### Added
|
|
186
260
|
|
|
187
|
-
-
|
|
188
|
-
-
|
|
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)
|
|
189
263
|
|
|
190
264
|
### Changed
|
|
191
265
|
|
|
192
|
-
-
|
|
193
|
-
-
|
|
194
|
-
-
|
|
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)
|
|
195
269
|
|
|
196
|
-
|
|
270
|
+
[2.0.0]: https://github.com/hanami/hanami-controller/compare/v2.0.0.rc1...v2.0.0
|
|
271
|
+
|
|
272
|
+
## [2.0.0.rc1] - 2022-11-08
|
|
197
273
|
|
|
198
274
|
### Changed
|
|
199
275
|
|
|
200
|
-
-
|
|
276
|
+
- Simplify assignment of response format: `response.format = :json` (was `response.format = format(:json)`). (Tim Riley in #400)
|
|
277
|
+
|
|
278
|
+
[2.0.0.rc1]: https://github.com/hanami/hanami-controller/compare/v2.0.0.beta4...v2.0.0.rc1
|
|
201
279
|
|
|
202
|
-
##
|
|
280
|
+
## [2.0.0.beta4] - 2022-10-24
|
|
203
281
|
|
|
204
282
|
### Added
|
|
205
283
|
|
|
206
|
-
-
|
|
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)
|
|
207
285
|
|
|
208
|
-
###
|
|
286
|
+
### Changed
|
|
209
287
|
|
|
210
|
-
-
|
|
211
|
-
-
|
|
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)
|
|
212
293
|
|
|
213
|
-
###
|
|
294
|
+
### Fixed
|
|
295
|
+
|
|
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)
|
|
214
298
|
|
|
215
|
-
|
|
216
|
-
- [Tim Riley] Add `Action.handle_exception` class method as a shortcut for `Hanami::Action::Config#handle_exception` (#394)
|
|
217
|
-
- [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)
|
|
218
|
-
- [Tim Riley] Make params validation schemas (defined in `params do` block) inheritable to subclasses (#394)
|
|
219
|
-
- [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)
|
|
299
|
+
[2.0.0.beta4]: https://github.com/hanami/hanami-controller/compare/v2.0.0.beta1...v2.0.0.beta4
|
|
220
300
|
|
|
221
|
-
##
|
|
301
|
+
## [2.0.0.beta1] - 2022-07-20
|
|
222
302
|
|
|
223
303
|
### Fixed
|
|
224
304
|
|
|
225
|
-
-
|
|
226
|
-
-
|
|
227
|
-
-
|
|
228
|
-
-
|
|
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)
|
|
229
309
|
|
|
230
|
-
|
|
310
|
+
[2.0.0.beta1]: https://github.com/hanami/hanami-controller/compare/v2.0.0.alpha8...v2.0.0.beta1
|
|
311
|
+
|
|
312
|
+
## [2.0.0.alpha8] - 2022-02-19
|
|
231
313
|
|
|
232
314
|
### Changed
|
|
233
315
|
|
|
234
|
-
-
|
|
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)
|
|
317
|
+
|
|
318
|
+
[2.0.0.alpha8]: https://github.com/hanami/hanami-controller/compare/v2.0.0.alpha6...v2.0.0.alpha8
|
|
235
319
|
|
|
236
|
-
##
|
|
320
|
+
## [2.0.0.alpha6] - 2022-02-10
|
|
237
321
|
|
|
238
322
|
### Added
|
|
239
323
|
|
|
240
|
-
-
|
|
324
|
+
- Official support for Ruby: MRI 3.1. (Luca Guidi in #359)
|
|
241
325
|
|
|
242
326
|
### Changed
|
|
243
327
|
|
|
244
|
-
-
|
|
245
|
-
-
|
|
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)
|
|
246
330
|
|
|
247
|
-
|
|
331
|
+
[2.0.0.alpha6]: https://github.com/hanami/hanami-controller/compare/v2.0.0.alpha5...v2.0.0.alpha6
|
|
332
|
+
|
|
333
|
+
## [2.0.0.alpha5] - 2022-01-12
|
|
248
334
|
|
|
249
335
|
### Added
|
|
250
336
|
|
|
251
|
-
-
|
|
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
|
|
252
340
|
|
|
253
|
-
##
|
|
341
|
+
## [2.0.0.alpha4] - 2021-12-07
|
|
254
342
|
|
|
255
343
|
### Added
|
|
256
344
|
|
|
257
|
-
-
|
|
258
|
-
-
|
|
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)
|
|
259
347
|
|
|
260
|
-
|
|
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
|
|
261
351
|
|
|
262
352
|
### Added
|
|
263
353
|
|
|
264
|
-
-
|
|
265
|
-
-
|
|
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)
|
|
266
356
|
|
|
267
357
|
### Changed
|
|
268
358
|
|
|
269
|
-
-
|
|
270
|
-
-
|
|
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
|
|
271
363
|
|
|
272
|
-
##
|
|
364
|
+
## [2.0.0.alpha2] - 2021-05-04
|
|
273
365
|
|
|
274
366
|
### Added
|
|
275
367
|
|
|
276
|
-
-
|
|
277
|
-
-
|
|
278
|
-
-
|
|
279
|
-
-
|
|
280
|
-
-
|
|
281
|
-
-
|
|
282
|
-
-
|
|
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)
|
|
283
375
|
|
|
284
|
-
###
|
|
376
|
+
### Changed
|
|
285
377
|
|
|
286
|
-
-
|
|
287
|
-
-
|
|
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)
|
|
288
381
|
|
|
289
|
-
###
|
|
382
|
+
### Fixed
|
|
290
383
|
|
|
291
|
-
-
|
|
292
|
-
-
|
|
293
|
-
- [Tim Riley] Rewritten `Hanami::Action::Flash`, based on Roda's `FlashHash`
|
|
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)
|
|
294
386
|
|
|
295
|
-
|
|
387
|
+
[2.0.0.alpha2]: https://github.com/hanami/hanami-controller/compare/v2.0.0.alpha1...v2.0.0.alpha2
|
|
388
|
+
|
|
389
|
+
## [2.0.0.alpha1] - 2019-01-30
|
|
296
390
|
|
|
297
391
|
### Added
|
|
298
392
|
|
|
299
|
-
-
|
|
300
|
-
-
|
|
301
|
-
-
|
|
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)
|
|
302
396
|
|
|
303
397
|
### Changed
|
|
304
398
|
|
|
305
|
-
-
|
|
306
|
-
-
|
|
307
|
-
-
|
|
308
|
-
-
|
|
309
|
-
-
|
|
310
|
-
-
|
|
311
|
-
-
|
|
312
|
-
-
|
|
313
|
-
-
|
|
314
|
-
-
|
|
315
|
-
-
|
|
316
|
-
-
|
|
317
|
-
-
|
|
318
|
-
-
|
|
319
|
-
-
|
|
320
|
-
-
|
|
321
|
-
-
|
|
322
|
-
-
|
|
323
|
-
-
|
|
324
|
-
-
|
|
325
|
-
-
|
|
326
|
-
-
|
|
327
|
-
-
|
|
328
|
-
-
|
|
329
|
-
-
|
|
330
|
-
-
|
|
331
|
-
-
|
|
332
|
-
-
|
|
333
|
-
-
|
|
334
|
-
-
|
|
335
|
-
-
|
|
336
|
-
-
|
|
337
|
-
-
|
|
338
|
-
-
|
|
339
|
-
-
|
|
340
|
-
-
|
|
341
|
-
-
|
|
342
|
-
-
|
|
343
|
-
-
|
|
344
|
-
-
|
|
345
|
-
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
-
|
|
354
|
-
|
|
355
|
-
|
|
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
|
|
356
454
|
|
|
357
455
|
### Fixed
|
|
358
456
|
|
|
359
|
-
-
|
|
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)
|
|
458
|
+
|
|
459
|
+
[1.3.2]: https://github.com/hanami/hanami-controller/compare/v1.3.1...v1.3.2
|
|
360
460
|
|
|
361
|
-
##
|
|
461
|
+
## [1.3.1] - 2019-01-18
|
|
362
462
|
|
|
363
463
|
### Added
|
|
364
464
|
|
|
365
|
-
-
|
|
366
|
-
-
|
|
465
|
+
- Official support for Ruby: MRI 2.6. (Luca Guidi in #317)
|
|
466
|
+
- Support `bundler` 2.0+. (Luca Guidi in #317)
|
|
367
467
|
|
|
368
|
-
|
|
468
|
+
[1.3.1]: https://github.com/hanami/hanami-controller/compare/v1.3.0...v1.3.1
|
|
469
|
+
|
|
470
|
+
## [1.3.0] - 2018-10-24
|
|
369
471
|
|
|
370
472
|
### Added
|
|
371
473
|
|
|
372
|
-
-
|
|
474
|
+
- Swappable JSON backed for `Hanami::Action::Flash` based on `Hanami::Utils::Json`. (Gustavo Caso in #306)
|
|
475
|
+
|
|
476
|
+
[1.3.0]: https://github.com/hanami/hanami-controller/compare/v1.3.0.beta1...v1.3.0
|
|
373
477
|
|
|
374
|
-
##
|
|
478
|
+
## [1.3.0.beta1] - 2018-08-08
|
|
375
479
|
|
|
376
480
|
### Added
|
|
377
481
|
|
|
378
|
-
-
|
|
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)
|
|
379
487
|
|
|
380
488
|
### Fixed
|
|
381
489
|
|
|
382
|
-
-
|
|
383
|
-
-
|
|
384
|
-
-
|
|
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)
|
|
385
493
|
|
|
386
|
-
|
|
494
|
+
[1.3.0.beta1]: https://github.com/hanami/hanami-controller/compare/v1.2.0...v1.3.0.beta1
|
|
387
495
|
|
|
388
|
-
|
|
496
|
+
## [1.2.0] - 2018-04-11
|
|
389
497
|
|
|
390
|
-
|
|
498
|
+
[1.2.0]: https://github.com/hanami/hanami-controller/compare/v1.2.0.rc2...v1.2.0
|
|
391
499
|
|
|
392
|
-
##
|
|
500
|
+
## [1.2.0.rc2] - 2018-04-06
|
|
393
501
|
|
|
394
502
|
### Added
|
|
395
503
|
|
|
396
|
-
-
|
|
504
|
+
- Introduce `Hanami::Action::Flash#each` and `#map`. (Gustavo Caso in #294)
|
|
505
|
+
|
|
506
|
+
[1.2.0.rc2]: https://github.com/hanami/hanami-controller/compare/v1.2.0.rc1...v1.2.0.rc2
|
|
397
507
|
|
|
398
|
-
##
|
|
508
|
+
## [1.2.0.rc1] - 2018-03-30
|
|
399
509
|
|
|
400
|
-
|
|
510
|
+
[1.2.0.rc1]: https://github.com/hanami/hanami-controller/compare/v1.2.0.beta2...v1.2.0.rc1
|
|
401
511
|
|
|
402
|
-
##
|
|
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
|
|
403
517
|
|
|
404
518
|
### Added
|
|
405
519
|
|
|
406
|
-
-
|
|
407
|
-
-
|
|
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)
|
|
408
522
|
|
|
409
523
|
### Fixed
|
|
410
524
|
|
|
411
|
-
-
|
|
525
|
+
- Raise meaningful exception when trying to access `session` or `flash` and `Hanami::Action::Session` wasn't included. (wheresmyjetpack in #207)
|
|
412
526
|
|
|
413
|
-
|
|
527
|
+
[1.2.0.beta1]: https://github.com/hanami/hanami-controller/compare/v1.1.1...v1.2.0.beta1
|
|
528
|
+
|
|
529
|
+
## [1.1.1] - 2017-11-22
|
|
414
530
|
|
|
415
531
|
### Fixed
|
|
416
532
|
|
|
417
|
-
-
|
|
418
|
-
-
|
|
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)
|
|
535
|
+
|
|
536
|
+
[1.1.1]: https://github.com/hanami/hanami-controller/compare/v1.1.0...v1.1.1
|
|
419
537
|
|
|
420
|
-
##
|
|
538
|
+
## [1.1.0] - 2017-10-25
|
|
421
539
|
|
|
422
540
|
### Added
|
|
423
541
|
|
|
424
|
-
-
|
|
542
|
+
- Introduce `Hanami::Action::CookieJar#each` to iterate through action's `cookies`. (Luca Guidi in #279)
|
|
425
543
|
|
|
426
|
-
|
|
544
|
+
[1.1.0]: https://github.com/hanami/hanami-controller/compare/v1.1.0.rc1...v1.1.0
|
|
427
545
|
|
|
428
|
-
##
|
|
546
|
+
## [1.1.0.rc1] - 2017-10-16
|
|
429
547
|
|
|
430
|
-
|
|
548
|
+
[1.1.0.rc1]: https://github.com/hanami/hanami-controller/compare/v1.1.0.beta3...v1.1.0.rc1
|
|
549
|
+
|
|
550
|
+
## [1.1.0.beta3] - 2017-10-04
|
|
551
|
+
|
|
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
|
|
431
555
|
|
|
432
556
|
### Added
|
|
433
557
|
|
|
434
|
-
-
|
|
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
|
|
435
561
|
|
|
436
|
-
##
|
|
562
|
+
## [1.1.0.beta1] - 2017-08-11
|
|
437
563
|
|
|
438
|
-
|
|
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
|
|
439
567
|
|
|
440
568
|
### Fixed
|
|
441
569
|
|
|
442
|
-
-
|
|
443
|
-
-
|
|
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
|
|
574
|
+
|
|
575
|
+
## [1.0.0] - 2017-04-06
|
|
576
|
+
|
|
577
|
+
[1.0.0]: https://github.com/hanami/hanami-controller/compare/v1.0.0.rc1...v1.0.0
|
|
444
578
|
|
|
445
|
-
##
|
|
579
|
+
## [1.0.0.rc1] - 2017-03-31
|
|
446
580
|
|
|
447
|
-
|
|
581
|
+
[1.0.0.rc1]: https://github.com/hanami/hanami-controller/compare/v1.0.0.beta3...v1.0.0.rc1
|
|
448
582
|
|
|
449
|
-
##
|
|
583
|
+
## [1.0.0.beta3] - 2017-03-17
|
|
450
584
|
|
|
451
585
|
### Changed
|
|
452
586
|
|
|
453
|
-
-
|
|
587
|
+
- `Action#flash` is now public API. (Luca Guidi in #262)
|
|
454
588
|
|
|
455
|
-
|
|
589
|
+
[1.0.0.beta3]: https://github.com/hanami/hanami-controller/compare/v1.0.0.beta2...v1.0.0.beta3
|
|
590
|
+
|
|
591
|
+
## [1.0.0.beta2] - 2017-03-02
|
|
456
592
|
|
|
457
593
|
### Added
|
|
458
594
|
|
|
459
|
-
-
|
|
595
|
+
- Add `Action#unsafe_send_file` to send files outside of the public directory of a project. (Marcello Rocha in #257)
|
|
460
596
|
|
|
461
597
|
### Fixed
|
|
462
598
|
|
|
463
|
-
-
|
|
464
|
-
-
|
|
465
|
-
-
|
|
466
|
-
-
|
|
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)
|
|
603
|
+
|
|
604
|
+
[1.0.0.beta2]: https://github.com/hanami/hanami-controller/compare/v1.0.0.beta1...v1.0.0.beta2
|
|
467
605
|
|
|
468
|
-
##
|
|
606
|
+
## [1.0.0.beta1] - 2017-02-14
|
|
469
607
|
|
|
470
608
|
### Added
|
|
471
609
|
|
|
472
|
-
-
|
|
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)
|
|
473
615
|
|
|
474
616
|
### Fixed
|
|
475
617
|
|
|
476
|
-
-
|
|
477
|
-
-
|
|
478
|
-
-
|
|
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)
|
|
479
621
|
|
|
480
|
-
|
|
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
|
|
481
625
|
|
|
482
|
-
|
|
626
|
+
### Added
|
|
483
627
|
|
|
484
|
-
|
|
628
|
+
- Add `flash` to the default exposures. (Luca Guidi in #233)
|
|
485
629
|
|
|
486
630
|
### Fixed
|
|
487
631
|
|
|
488
|
-
-
|
|
489
|
-
|
|
632
|
+
- Don't pollute Rack env's `rack.exception` key if an exception is handled. (Thorbjørn Hermansen in #234)
|
|
633
|
+
|
|
634
|
+
[0.8.1]: https://github.com/hanami/hanami-controller/compare/v0.8.0...v0.8.1
|
|
490
635
|
|
|
491
|
-
##
|
|
636
|
+
## [0.8.0] - 2016-11-15
|
|
492
637
|
|
|
493
638
|
### Added
|
|
494
639
|
|
|
495
|
-
-
|
|
640
|
+
- Allow `BaseParams#get` to read (nested) arrays. (Marion Duprey in #227)
|
|
496
641
|
|
|
497
|
-
###
|
|
642
|
+
### Changed
|
|
498
643
|
|
|
499
|
-
-
|
|
500
|
-
- [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)
|
|
501
645
|
|
|
502
|
-
###
|
|
646
|
+
### Fixed
|
|
503
647
|
|
|
504
|
-
-
|
|
648
|
+
- Respect custom formats when referenced by HTTP `Accept`. (Russell Cloak in #221)
|
|
649
|
+
- Don't symbolize raw params. (Kyle Chong in #224)
|
|
505
650
|
|
|
506
|
-
|
|
651
|
+
[0.8.0]: https://github.com/hanami/hanami-controller/compare/v0.7.1...v0.8.0
|
|
652
|
+
|
|
653
|
+
## [0.7.1] - 2016-10-06
|
|
507
654
|
|
|
508
655
|
### Added
|
|
509
656
|
|
|
510
|
-
-
|
|
511
|
-
-
|
|
657
|
+
- Introduced `parsed_request_body` for action. (Kyle Chong in #155)
|
|
658
|
+
- Introduced `Hanami::Action::BaseParams#each`. (Luca Guidi in #176)
|
|
512
659
|
|
|
513
|
-
###
|
|
660
|
+
### Changed
|
|
514
661
|
|
|
515
|
-
-
|
|
516
|
-
- [Kyle Chong] Don't stringify uploaded files
|
|
517
|
-
- [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)
|
|
518
663
|
|
|
519
|
-
###
|
|
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)
|
|
520
669
|
|
|
521
|
-
|
|
670
|
+
[0.7.1]: https://github.com/hanami/hanami-controller/compare/v0.7.0...v0.7.1
|
|
522
671
|
|
|
523
|
-
##
|
|
672
|
+
## [0.7.0] - 2016-07-22
|
|
524
673
|
|
|
525
674
|
### Added
|
|
526
675
|
|
|
527
|
-
-
|
|
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)
|
|
528
678
|
|
|
529
|
-
###
|
|
679
|
+
### Changed
|
|
530
680
|
|
|
531
|
-
-
|
|
532
|
-
-
|
|
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)
|
|
533
688
|
|
|
534
|
-
###
|
|
689
|
+
### Fixed
|
|
690
|
+
|
|
691
|
+
- Params are deeply symbolized. (Luca Guidi in #verbman)
|
|
692
|
+
- Send only changed cookies in HTTP response. (Artem Nistratov in #153)
|
|
535
693
|
|
|
536
|
-
|
|
537
|
-
- [Luca Guidi] Param validations now require you to add `hanami-validations` in `Gemfile`.
|
|
538
|
-
- [Luca Guidi] Removed "_indifferent access_" for params. Since now on, only symbols are allowed.
|
|
539
|
-
- [Luca Guidi] Params are immutable
|
|
540
|
-
- [Luca Guidi] Params validations syntax has changed
|
|
541
|
-
- [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.
|
|
542
|
-
- [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
|
|
543
695
|
|
|
544
|
-
##
|
|
696
|
+
## [0.6.1] - 2016-02-05
|
|
545
697
|
|
|
546
698
|
### Changed
|
|
547
699
|
|
|
548
|
-
-
|
|
700
|
+
- Optimise memory usage by freezing MIME types constant. (Anatolii Didukh in #152)
|
|
549
701
|
|
|
550
|
-
|
|
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
|
|
551
705
|
|
|
552
706
|
### Changed
|
|
553
707
|
|
|
554
|
-
-
|
|
708
|
+
- Renamed the project. (Luca Guidi)
|
|
709
|
+
|
|
710
|
+
[0.6.0]: https://github.com/hanami/hanami-controller/compare/v0.5.1...v0.6.0
|
|
555
711
|
|
|
556
|
-
##
|
|
712
|
+
## [0.5.1] - 2016-01-19
|
|
557
713
|
|
|
558
714
|
### Fixed
|
|
559
715
|
|
|
560
|
-
-
|
|
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)
|
|
561
717
|
|
|
562
|
-
|
|
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
|
|
563
721
|
|
|
564
722
|
### Added
|
|
565
723
|
|
|
566
|
-
-
|
|
724
|
+
- Reference a raised exception in Rack env's `rack.exception`. Compatibility with exception reporting SaaS. (Luca Guidi in #129)
|
|
567
725
|
|
|
568
|
-
###
|
|
726
|
+
### Changed
|
|
569
727
|
|
|
570
|
-
-
|
|
571
|
-
-
|
|
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)
|
|
572
731
|
|
|
573
|
-
###
|
|
732
|
+
### Fixed
|
|
733
|
+
|
|
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)
|
|
574
736
|
|
|
575
|
-
|
|
576
|
-
- [Cainã Costa] Made `Lotus::Action#session` a public method for improved unit testing
|
|
577
|
-
- [Karim Tarek] Introduced `Lotus::Controller::Error` and let all the framework exceptions to inherit from it.
|
|
737
|
+
[0.5.0]: https://github.com/hanami/hanami-controller/compare/v0.4.6...v0.5.0
|
|
578
738
|
|
|
579
|
-
##
|
|
739
|
+
## [0.4.6] - 2015-12-04
|
|
580
740
|
|
|
581
741
|
### Added
|
|
582
742
|
|
|
583
|
-
-
|
|
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)
|
|
584
744
|
|
|
585
|
-
|
|
745
|
+
[0.4.6]: https://github.com/hanami/hanami-controller/compare/v0.4.5...v0.4.6
|
|
746
|
+
|
|
747
|
+
## [0.4.5] - 2015-09-30
|
|
586
748
|
|
|
587
749
|
### Added
|
|
588
750
|
|
|
589
|
-
-
|
|
590
|
-
-
|
|
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)
|
|
591
753
|
|
|
592
|
-
###
|
|
754
|
+
### Deprecated
|
|
755
|
+
|
|
756
|
+
- Deprecate `#default_format` in favor of: `#default_request_format`. (Theo Felippe in #122)
|
|
593
757
|
|
|
594
|
-
|
|
758
|
+
[0.4.5]: https://github.com/hanami/hanami-controller/compare/v0.4.4...v0.4.5
|
|
595
759
|
|
|
596
|
-
##
|
|
760
|
+
## [0.4.4] - 2015-06-23
|
|
597
761
|
|
|
598
762
|
### Added
|
|
599
763
|
|
|
600
|
-
-
|
|
764
|
+
- Security protection against Cross Site Request Forgery (CSRF). (Luca Guidi in #118)
|
|
601
765
|
|
|
602
766
|
### Fixed
|
|
603
767
|
|
|
604
|
-
-
|
|
768
|
+
- Ensure nested params to be correctly coerced to Hash. (Matthew Bellantoni in #107)
|
|
605
769
|
|
|
606
|
-
|
|
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
|
|
607
773
|
|
|
608
774
|
### Added
|
|
609
775
|
|
|
610
|
-
-
|
|
611
|
-
-
|
|
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)
|
|
612
778
|
|
|
613
|
-
|
|
779
|
+
[0.4.3]: https://github.com/hanami/hanami-controller/compare/v0.4.2...v0.4.3
|
|
614
780
|
|
|
615
|
-
|
|
781
|
+
## [0.4.2] - 2015-05-15
|
|
616
782
|
|
|
617
|
-
|
|
783
|
+
### Fixed
|
|
618
784
|
|
|
619
|
-
|
|
785
|
+
- Ensure `Lotus::Action::Params#to_h` to return `::Hash` at the top level. (Luca Guidi in #101)
|
|
620
786
|
|
|
621
|
-
|
|
787
|
+
[0.4.2]: https://github.com/hanami/hanami-controller/compare/v0.4.1...v0.4.2
|
|
622
788
|
|
|
623
|
-
|
|
624
|
-
- [Luca Guidi] Ensure `Lotus::Action#redirect_to` to return `::String` for Rack servers compatibility.
|
|
789
|
+
## [0.4.1] - 2015-05-15
|
|
625
790
|
|
|
626
791
|
### Changed
|
|
627
792
|
|
|
628
|
-
-
|
|
629
|
-
|
|
630
|
-
|
|
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)
|
|
800
|
+
|
|
801
|
+
[0.4.1]: https://github.com/hanami/hanami-controller/compare/v0.4.0...v0.4.1
|
|
631
802
|
|
|
632
|
-
##
|
|
803
|
+
## [0.4.0] - 2015-03-23
|
|
633
804
|
|
|
634
805
|
### Added
|
|
635
806
|
|
|
636
|
-
-
|
|
637
|
-
-
|
|
638
|
-
-
|
|
639
|
-
-
|
|
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)
|
|
640
811
|
|
|
641
812
|
### Changed
|
|
642
813
|
|
|
643
|
-
-
|
|
814
|
+
- `redirect_to` now is a flow control method: it terminates the execution of an action, including the callbacks. (Alfonso Uceda Pompa in #73)
|
|
644
815
|
|
|
645
|
-
|
|
816
|
+
[0.4.0]: https://github.com/hanami/hanami-controller/compare/v0.3.2...v0.4.0
|
|
817
|
+
|
|
818
|
+
## [0.3.2] - 2015-01-30
|
|
646
819
|
|
|
647
820
|
### Added
|
|
648
821
|
|
|
649
|
-
-
|
|
650
|
-
-
|
|
651
|
-
-
|
|
652
|
-
-
|
|
653
|
-
-
|
|
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)
|
|
654
827
|
|
|
655
828
|
### Fixed
|
|
656
829
|
|
|
657
|
-
-
|
|
658
|
-
-
|
|
659
|
-
-
|
|
660
|
-
-
|
|
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)
|
|
834
|
+
|
|
835
|
+
[0.3.2]: https://github.com/hanami/hanami-controller/compare/v0.3.1...v0.3.2
|
|
661
836
|
|
|
662
|
-
##
|
|
837
|
+
## [0.3.1] - 2015-01-08
|
|
663
838
|
|
|
664
839
|
### Added
|
|
665
840
|
|
|
666
|
-
-
|
|
841
|
+
- Introduced `Action#request` which returns an instance a `Rack::Request` compliant object: `Lotus::Action::Request`. (Lasse Skindstad Ebert in #48)
|
|
667
842
|
|
|
668
843
|
### Fixed
|
|
669
844
|
|
|
670
|
-
-
|
|
845
|
+
- Ensure params to return coerced values. (Steve Hodgkiss in #54)
|
|
671
846
|
|
|
672
|
-
|
|
847
|
+
[0.3.1]: https://github.com/hanami/hanami-controller/compare/v0.3.0...v0.3.1
|
|
848
|
+
|
|
849
|
+
## [0.3.0] - 2014-12-23
|
|
673
850
|
|
|
674
851
|
### Added
|
|
675
852
|
|
|
676
|
-
-
|
|
677
|
-
-
|
|
678
|
-
-
|
|
679
|
-
-
|
|
680
|
-
-
|
|
681
|
-
-
|
|
682
|
-
-
|
|
683
|
-
-
|
|
684
|
-
-
|
|
685
|
-
-
|
|
686
|
-
-
|
|
687
|
-
-
|
|
688
|
-
-
|
|
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)
|
|
689
866
|
|
|
690
867
|
### Changed
|
|
691
868
|
|
|
692
|
-
-
|
|
693
|
-
-
|
|
694
|
-
-
|
|
695
|
-
-
|
|
696
|
-
-
|
|
697
|
-
-
|
|
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)
|
|
698
875
|
|
|
699
876
|
### Fixed
|
|
700
877
|
|
|
701
|
-
-
|
|
878
|
+
- Don't let exposures definition to override existing methods. (Luca Guidi in #40)
|
|
879
|
+
|
|
880
|
+
[0.3.0]: https://github.com/hanami/hanami-controller/compare/v0.2.0...v0.3.0
|
|
702
881
|
|
|
703
|
-
##
|
|
882
|
+
## [0.2.0] - 2014-06-23
|
|
704
883
|
|
|
705
884
|
### Added
|
|
706
885
|
|
|
707
|
-
-
|
|
708
|
-
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
-
|
|
712
|
-
-
|
|
713
|
-
-
|
|
714
|
-
-
|
|
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)
|
|
715
894
|
|
|
716
895
|
### Changed
|
|
717
896
|
|
|
718
|
-
-
|
|
719
|
-
-
|
|
720
|
-
-
|
|
721
|
-
-
|
|
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)
|
|
722
901
|
|
|
723
902
|
### Fixed
|
|
724
903
|
|
|
725
|
-
-
|
|
904
|
+
- Reference exception in `rack.errors`. (Krzysztof Zalewski in #26)
|
|
726
905
|
|
|
727
|
-
|
|
906
|
+
[0.2.0]: https://github.com/hanami/hanami-controller/compare/v0.1.0...v0.2.0
|
|
907
|
+
|
|
908
|
+
## [0.1.0] - 2014-02-23
|
|
728
909
|
|
|
729
910
|
### Added
|
|
730
911
|
|
|
731
|
-
-
|
|
732
|
-
-
|
|
733
|
-
-
|
|
734
|
-
-
|
|
735
|
-
-
|
|
736
|
-
-
|
|
737
|
-
-
|
|
738
|
-
-
|
|
739
|
-
-
|
|
740
|
-
-
|
|
741
|
-
-
|
|
742
|
-
-
|
|
743
|
-
-
|
|
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
|