hanami-controller/CHANGELOG.md

553 lines
22 KiB
Markdown
Raw Permalink Normal View History

2016-01-19 18:33:45 +00:00
# Hanami::Controller
2022-07-11 19:43:39 +00:00
2014-12-19 09:42:23 +00:00
Complete, fast and testable actions for Rack
2022-11-07 10:38:03 +00:00
## v2.0.0.rc1 - 2022-11-08
### Changed
- [Tim Riley] Simplify assignment of response format: `response.format = :json` (was `response.format = format(:json)`)
2022-10-23 19:46:17 +00:00
## v2.0.0.beta4 - 2022-10-24
### Added
- [Tim Riley] 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 (#399)
### Fixed
- [Benjamin Klotz] When a params validation schema is provided (in a `params do` block), only return the validated params from `request.params` (#375)
- [Sean Collins] Handle dry-schema's messages hash now being frozen by default (#391)
### Changed
- [Tim Riley] 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. (#396)
- [Tim Riley] Add `Action.handle_exception` class method as a shortcut for `Hanami::Action::Config#handle_exception` (#394)
- [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)
- [Tim Riley] Make params validation schemas (defined in `params do` block) inheritable to subclasses (#394)
- [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)
2022-07-18 08:20:18 +00:00
## v2.0.0.beta1 - 2022-07-20
2022-07-11 19:43:39 +00:00
### Fixed
- [Benjamin Klotz] Using `Hanami::Action.params` without having `hanami-validations` installed now returns a user-friendly error
- [Narinda Reeders] Ensure HEAD responses to send empty body, but preserve headers
- [Narinda Reeders] Ensure HEAD redirect responses to return redirect headers
- [Andrew Croome] Do not automatically render halted requests
## v2.0.0.alpha8 - 2022-02-19
### Changed
2022-07-11 19:43:39 +00:00
- [Tim Riley] 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.
2022-02-09 08:43:18 +00:00
## v2.0.0.alpha6 - 2022-02-10
2022-07-11 19:43:39 +00:00
2022-02-09 08:43:18 +00:00
### Added
2022-07-11 19:43:39 +00:00
2022-02-09 08:43:18 +00:00
- [Luca Guidi] Official support for Ruby: MRI 3.1
### Changed
2022-07-11 19:43:39 +00:00
2022-02-09 08:43:18 +00:00
- [Luca Guidi] Drop support for Ruby: MRI 2.6, and 2.7.
- [Sean Collins] 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`.
2022-01-12 11:28:26 +00:00
## v2.0.0.alpha5 - 2022-01-12
2022-07-11 19:43:39 +00:00
2022-01-12 11:28:26 +00:00
### Added
2022-07-11 19:43:39 +00:00
2022-01-12 11:28:26 +00:00
- [Philip Arndt] Added "rss" ("application/rss+xml") to list of supported MIME types
2021-12-03 13:52:40 +00:00
## v2.0.0.alpha4 - 2021-12-07
2022-07-11 19:43:39 +00:00
2021-12-03 13:52:40 +00:00
### Added
2022-07-11 19:43:39 +00:00
2021-12-03 13:52:40 +00:00
- [Luca Guidi] Manage Content Security Policy (CSP) defaults and new API via `Hanami::Action::ApplicationConfiguration#content_security_policy`
- [Tim Riley & Marc Busqué] Provide access to routes inside all application actions via `Hanami::Action::ApplicationAction#routes`
2021-11-09 12:32:19 +00:00
## v2.0.0.alpha3 - 2021-11-09
2022-07-11 19:43:39 +00:00
2021-11-08 12:39:22 +00:00
### Added
2022-07-11 19:43:39 +00:00
2021-11-08 12:39:22 +00:00
- [Luca Guidi] Automatically include session behavior in `Hanami::Action` when sessions are enabled via Hanami application config
2021-11-08 15:00:40 +00:00
- [Sean Collins] Pass exposures from action to view
2021-11-08 12:39:22 +00:00
### Changed
2022-07-11 19:43:39 +00:00
2021-11-08 12:39:22 +00:00
- [Tim Riley] (Internal) Updated settings to use updated `setting` API in dry-configurable 0.13.0
2021-11-08 16:36:19 +00:00
- [Sean Collins] Move automatic view rendering from `handle` to `finish`
2021-11-08 12:39:22 +00:00
2021-05-03 15:17:03 +00:00
## v2.0.0.alpha2 - 2021-05-04
2022-07-11 19:43:39 +00:00
2021-05-03 15:17:03 +00:00
### Added
2022-07-11 19:43:39 +00:00
2021-05-03 15:17:03 +00:00
- [Luca Guidi] Official support for Ruby: MRI 3.0
- [Tim Riley] Introduced `Hanami::Action::ApplicationAction`
- [Tim Riley] Introduced `Hanami::Action::Configuration`
- [Tim Riley] Introduced `Hanami::Action::ApplicationConfiguration`
- [Tim Riley] Auto-inject a paired view into any `Hanami::Action::ApplicationAction` instance
- [Tim Riley] Auto-render `Hanami::Action::ApplicationAction` subclasses that don't implement `#handle`
- [Tim Riley] Enable CSRF protection automatically when HTTP sessions are enabled
### Fixed
2022-07-11 19:43:39 +00:00
2021-05-03 15:17:03 +00:00
- [Luca Guidi] Ensure `Hanami::Action::Response#renderable?` to return `false` when body is set
- [Andrew Croome] Ensure `Hanami::Action.accept` to use Rack `CONTENT_TYPE` for the _before callback_ check
### Changed
2022-07-11 19:43:39 +00:00
2021-05-03 15:17:03 +00:00
- [Luca Guidi] Drop support for Ruby: MRI 2.5.
- [Tim Riley] Removed `Hanami::Action.handle_exception` in favor of `Hanami::Action.config.handle_exception`
- [Tim Riley] Rewritten `Hanami::Action::Flash`, based on Roda's `FlashHash`
2019-01-26 18:21:36 +00:00
## v2.0.0.alpha1 - 2019-01-30
2022-07-11 19:43:39 +00:00
2017-12-15 17:31:00 +00:00
### Added
2022-07-11 19:43:39 +00:00
2017-12-15 17:31:00 +00:00
- [Luca Guidi] `Hanami::Action::Request#session` to access the HTTP session as it was originally sent
- [Luca Guidi] `Hanami::Action::Request#cookies` to access the HTTP cookies as they were originally sent
2019-01-29 08:25:18 +00:00
- [Luca Guidi & Tim Riley] Allow to build a deep inheritance chain for actions
2017-12-15 17:31:00 +00:00
### Changed
2022-07-11 19:43:39 +00:00
2019-01-26 18:21:36 +00:00
- [Luca Guidi] Drop support for Ruby: MRI 2.3, and 2.4.
2017-12-15 17:31:00 +00:00
- [Luca Guidi] `Hanami::Action` is a superclass
- [Luca Guidi] `Hanami::Action#initialize` requires a `configuration:` keyword argument
- [Luca Guidi] `Hanami::Action#initialize` returns a frozen action instance
2019-01-29 08:25:18 +00:00
- [Tim Riley] `Hanami::Action` subclasses must implement `#handle` instead of `#call`
- [Luca Guidi] `Hanami::Action#handle` accepts `Hanami::Action::Request` and `Hanami::Action::Response`
- [Luca Guidi] `Hanami::Action#handle` returns `Hanami::Action::Response`
2017-12-15 17:31:00 +00:00
- [Luca Guidi] Removed `Hanami::Controller.configure`, `.configuration`, `.duplicate`, and `.load!`
- [Luca Guidi] Removed `Hanami::Action.use` to mount Rack middleware at the action level
- [Luca Guidi] `Hanami::Controller::Configuration` changed syntax from DSL style to setters (eg. `Hanami::Controller::Configuration.new { |c| c.default_request_format = :html }`)
- [Luca Guidi] `Hanami::Controller::Configuration#initialize` returns a frozen configuration instance
- [Luca Guidi] Removed `Hanami::Controller::Configuration#prepare`
- [Luca Guidi] Removed `Hanami::Action.configuration`
- [Luca Guidi] Removed `Hanami::Action.configuration.handle_exceptions`
2017-12-15 17:31:00 +00:00
- [Luca Guidi] Removed `Hanami::Action.configuration.default_request_format` in favor of `#default_request_format`
- [Luca Guidi] Removed `Hanami::Action.configuration.default_charset` in favor of `#default_charset`
- [Luca Guidi] Removed `Hanami::Action.configuration.format` to register a MIME Type for a single action. Please use the configuration.
- [Luca Guidi] Removed `Hanami::Action.expose` in favor of `Hanami::Action::Response#[]=` and `#[]`
- [Luca Guidi] Removed `Hanami::Action#status=` in favor of `Hanami::Action::Response#status=`
- [Luca Guidi] Removed `Hanami::Action#body=` in favor of `Hanami::Action::Response#body=`
- [Luca Guidi] Removed `Hanami::Action#headers` in favor of `Hanami::Action::Response#headers`
- [Luca Guidi] Removed `Hanami::Action#accept?` in favor of `Hanami::Action::Request#accept?`
- [Luca Guidi] Removed `Hanami::Action#format` in favor of `Hanami::Action::Response#format`
- [Luca Guidi] Introduced `Hanami::Action#format` as factory to assign response format: `res.format = format(:json)` or `res.format = format("application/json")`
- [Luca Guidi] Removed `Hanami::Action#format=` in favor of `Hanami::Action::Response#format=`
2019-01-29 08:25:18 +00:00
- [Gustavo Caso] `Hanami::Action.accept` now looks at request `Content-Type` header to accept/deny a request
2017-12-15 17:31:00 +00:00
- [Luca Guidi] Removed `Hanami::Action#request_id` in favor of `Hanami::Action::Request#id`
2019-01-29 08:25:18 +00:00
- [Gustavo Caso] Removed `Hanami::Action#parsed_request_body` in favor of `Hanami::Action::Request#parsed_body`
2017-12-15 17:31:00 +00:00
- [Luca Guidi] Removed `Hanami::Action#head?` in favor of `Hanami::Action::Request#head?`
- [Luca Guidi] Removed `Hanami::Action#status` in favor of `Hanami::Action::Response#status=` and `#body=`
- [Luca Guidi] Removed `Hanami::Action#session` in favor of `Hanami::Action::Response#session`
- [Luca Guidi] Removed `Hanami::Action#cookies` in favor of `Hanami::Action::Response#cookies`
- [Luca Guidi] Removed `Hanami::Action#flash` in favor of `Hanami::Action::Response#flash`
- [Luca Guidi] Removed `Hanami::Action#redirect_to` in favor of `Hanami::Action::Response#redirect_to`
- [Luca Guidi] Removed `Hanami::Action#cache_control`, `#expires`, and `#fresh` in favor of `Hanami::Action::Response#cache_control`, `#expires`, and `#fresh`, respectively
- [Luca Guidi] Removed `Hanami::Action#send_file` and `#unsafe_send_file` in favor of `Hanami::Action::Response#send_file` and `#unsafe_send_file`, respectively
- [Luca Guidi] Removed `Hanami::Action#errors`
2019-01-29 08:25:18 +00:00
- [Gustavo Caso] Removed body cleanup for `HEAD` requests
2017-12-15 17:31:00 +00:00
- [Luca Guidi] `Hanami::Action` callback hooks now accept `Hanami::Action::Request` and `Hanami::Action::Response` arguments
- [Luca Guidi] When an exception is raised, it won't be caught, unless it's handled
2017-12-15 17:31:00 +00:00
- [Luca Guidi] `Hanami::Action` exception handlers now accept `Hanami::Action::Request`, `Hanami::Action::Response`, and exception arguments
2020-01-14 14:13:39 +00:00
## v1.3.3 - 2020-01-14
2022-07-11 19:43:39 +00:00
2020-01-14 14:13:39 +00:00
### Added
2022-07-11 19:43:39 +00:00
2020-01-14 14:13:39 +00:00
- [Luca Guidi] Official support for Ruby: MRI 2.7
- [Luca Guidi] Support `rack` 2.1
- [Luca Guidi] Support for both `hanami-validations` 1 and 2
2019-06-28 07:16:39 +00:00
## v1.3.2 - 2019-06-28
2022-07-11 19:43:39 +00:00
2019-06-28 07:16:39 +00:00
### Fixed
2022-07-11 19:43:39 +00:00
2019-06-28 07:16:39 +00:00
- [Ian Ker-Seymer] Ensure `Etag` to work when `If-Modified-Since` is sent from browser and upstream proxy sets `Last-Modified` automatically.
2019-01-18 15:03:53 +00:00
## v1.3.1 - 2019-01-18
2022-07-11 19:43:39 +00:00
2019-01-15 08:17:29 +00:00
### Added
2022-07-11 19:43:39 +00:00
2019-01-15 08:17:29 +00:00
- [Luca Guidi] Official support for Ruby: MRI 2.6
- [Luca Guidi] Support `bundler` 2.0+
2018-10-23 06:44:39 +00:00
## v1.3.0 - 2018-10-24
2022-07-11 19:43:39 +00:00
2018-10-23 06:44:39 +00:00
### Added
2022-07-11 19:43:39 +00:00
2018-10-23 06:44:39 +00:00
- [Gustavo Caso] Swappable JSON backed for `Hanami::Action::Flash` based on `Hanami::Utils::Json`
2018-08-02 15:18:18 +00:00
## v1.3.0.beta1 - 2018-08-08
2022-07-11 19:43:39 +00:00
2018-08-02 15:18:18 +00:00
### Added
2022-07-11 19:43:39 +00:00
2018-08-02 15:18:18 +00:00
- [Luca Guidi] Official support for JRuby 9.2.0.0
### Fixed
2022-07-11 19:43:39 +00:00
2018-08-02 15:18:18 +00:00
- [Yuji Ueki] 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.
- [Gustavo Caso] Don't show flash message for the request after a HTTP redirect.
- [Gustavo Caso] Ensure `Hanami::Action::Flash#each`, `#map`, and `#empty?` to not reference stale flash data.
### Deprecated
2022-07-11 19:43:39 +00:00
2018-08-02 15:18:18 +00:00
- [Gustavo Caso] Deprecate `Hanami::Action#parsed_request_body`
2018-04-12 07:23:28 +00:00
2018-04-10 08:38:07 +00:00
## v1.2.0 - 2018-04-11
2018-04-05 14:54:38 +00:00
## v1.2.0.rc2 - 2018-04-06
2022-07-11 19:43:39 +00:00
2018-04-05 14:54:38 +00:00
### Added
2022-07-11 19:43:39 +00:00
2018-04-05 14:54:38 +00:00
- [Gustavo Caso] Introduce `Hanami::Action::Flash#each` and `#map`
2018-03-29 13:16:03 +00:00
## v1.2.0.rc1 - 2018-03-30
2018-03-23 10:24:46 +00:00
## v1.2.0.beta2 - 2018-03-23
2018-02-27 14:58:20 +00:00
## v1.2.0.beta1 - 2018-02-28
2022-07-11 19:43:39 +00:00
2018-02-27 14:58:20 +00:00
### Added
2022-07-11 19:43:39 +00:00
2018-02-27 14:58:20 +00:00
- [Luca Guidi] Official support for Ruby: MRI 2.5
- [Sergey Fedorov] Introduce `Hanami::Action.content_type` to accept/reject requests according to their `Content-Type` header.
### Fixed
2022-07-11 19:43:39 +00:00
2018-02-27 14:58:20 +00:00
- [wheresmyjetpack] Raise meaningful exception when trying to access `session` or `flash` and `Hanami::Action::Session` wasn't included.
2017-11-22 17:35:44 +00:00
## v1.1.1 - 2017-11-22
2022-07-11 19:43:39 +00:00
2017-11-22 17:35:44 +00:00
### Fixed
2022-07-11 19:43:39 +00:00
2017-11-22 17:35:44 +00:00
- [Luca Guidi] Ensure `Hanami::Action#send_file` and `#unsafe_send_file` to run `after` action callbacks
- [Luca Guidi] Ensure Rack env to have the `REQUEST_METHOD` key set to `GET` during actions unit tests
2017-10-24 14:59:32 +00:00
## v1.1.0 - 2017-10-25
2022-07-11 19:43:39 +00:00
2017-10-24 14:59:32 +00:00
### Added
2022-07-11 19:43:39 +00:00
2017-10-24 14:59:32 +00:00
- [Luca Guidi] Introduce `Hanami::Action::CookieJar#each` to iterate through action's `cookies`
2017-10-15 12:59:08 +00:00
## v1.1.0.rc1 - 2017-10-16
2017-10-04 09:34:50 +00:00
## v1.1.0.beta3 - 2017-10-04
2017-10-03 09:34:50 +00:00
## v1.1.0.beta2 - 2017-10-03
2022-07-11 19:43:39 +00:00
### Added
2022-07-11 19:43:39 +00:00
- [Luca Guidi] Introduce `Hanami::Action::Params::Errors#add` to add errors not generated by params validations
2017-08-11 20:48:47 +00:00
## v1.1.0.beta1 - 2017-08-11
2017-08-09 16:03:26 +00:00
2017-07-10 11:06:54 +00:00
## v1.0.1 - 2017-07-10
2022-07-11 19:43:39 +00:00
2017-06-05 10:40:52 +00:00
### Fixed
2022-07-11 19:43:39 +00:00
2017-06-05 10:40:52 +00:00
- [Marcello Rocha] Ensure validation params to be symbolized in all the environments
2017-07-10 11:06:54 +00:00
- [Marcello Rocha] Fix regression (`1.0.0`) about MIME type priority, during the evaluation of a weighted `Accept` HTTP header
2017-06-05 10:40:52 +00:00
2017-04-05 08:52:18 +00:00
## v1.0.0 - 2017-04-06
2017-03-31 05:02:22 +00:00
## v1.0.0.rc1 - 2017-03-31
2017-03-17 09:23:56 +00:00
## v1.0.0.beta3 - 2017-03-17
2022-07-11 19:43:39 +00:00
2017-03-17 09:23:56 +00:00
### Changed
2022-07-11 19:43:39 +00:00
2017-03-17 09:23:56 +00:00
- [Luca Guidi] `Action#flash` is now public API
2017-03-13 10:09:20 +00:00
2017-03-01 12:30:16 +00:00
## v1.0.0.beta2 - 2017-03-02
2022-07-11 19:43:39 +00:00
2017-03-01 12:30:16 +00:00
### Added
2022-07-11 19:43:39 +00:00
2017-03-01 12:30:16 +00:00
- [Marcello Rocha] Add `Action#unsafe_send_file` to send files outside of the public directory of a project
### Fixed
2022-07-11 19:43:39 +00:00
2017-03-01 12:30:16 +00:00
- [Anton Davydov] Ensure HTTP Cache to not crash when `HTTP_IF_MODIFIED_SINCE` and `HTTP_IF_NONE_MATCH` have blank values
- [Luca Guidi] Keep flash values after a redirect
- [Craig M. Wellington & Luca Guidi] Ensure to return 404 when `Action#send_file` cannot find a file with a globbed route
- [Luca Guidi] Don't mutate Rack env when sending files
2017-03-01 12:30:16 +00:00
## v1.0.0.beta1 - 2017-02-14
2022-07-11 19:43:39 +00:00
2017-02-08 15:56:55 +00:00
### Added
2022-07-11 19:43:39 +00:00
2017-02-08 15:56:55 +00:00
- [Luca Guidi] Official support for Ruby: MRI 2.4
### Fixed
2022-07-11 19:43:39 +00:00
2017-02-08 15:56:55 +00:00
- [Marcello Rocha & Luca Guidi] Avoid MIME type conflicts for `Action#format` detection
- [Matias H. Leidemer & Luca Guidi] Ensure `Flash` to return only fresh data
- [Luca Guidi] Ensure `session` keys to be accessed as symbols in action unit tests
### Changed
2022-07-11 19:43:39 +00:00
2017-02-08 15:56:55 +00:00
- [Anton Davydov & Luca Guidi] Make it work only with Rack 2.0
2016-12-19 15:45:27 +00:00
## v0.8.1 - 2016-12-19
2022-07-11 19:43:39 +00:00
2016-12-19 10:32:58 +00:00
### Fixed
2022-07-11 19:43:39 +00:00
2016-12-19 10:32:58 +00:00
- [Thorbjørn Hermansen] Don't pollute Rack env's `rack.exception` key if an exception is handled
- [Luca Guidi] Add `flash` to the default exposures
2016-11-15 13:13:45 +00:00
## v0.8.0 - 2016-11-15
2022-07-11 19:43:39 +00:00
2016-11-09 17:15:59 +00:00
### Added
2022-07-11 19:43:39 +00:00
2016-11-09 17:15:59 +00:00
- [Marion Duprey] Allow `BaseParams#get` to read (nested) arrays
### Fixed
2022-07-11 19:43:39 +00:00
2016-11-09 17:15:59 +00:00
- [Russell Cloak] Respect custom formats when referenced by HTTP `Accept`
- [Kyle Chong] Don't symbolize raw params
### Changed
2022-07-11 19:43:39 +00:00
2016-11-09 17:15:59 +00:00
- [Luca Guidi] 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')`)
2016-10-06 09:29:08 +00:00
## v0.7.1 - 2016-10-06
2022-07-11 19:43:39 +00:00
2016-10-06 09:29:08 +00:00
### Added
2022-07-11 19:43:39 +00:00
2016-10-06 09:29:08 +00:00
- [Kyle Chong] Introduced `parsed_request_body` for action
- [Luca Guidi] Introduced `Hanami::Action::BaseParams#each`
### Fixed
2022-07-11 19:43:39 +00:00
2016-10-06 09:29:08 +00:00
- [Ayleen McCann] Use default content type when `HTTP_ACCEPT` is `*/*`
- [Kyle Chong] Don't stringify uploaded files
- [Kyle Chong] Don't stringify params values when not necessary
### Changed
2022-07-11 19:43:39 +00:00
2016-10-06 09:29:08 +00:00
- [akhramov & Luca Guidi] Raise `Hanami::Controller::IllegalExposureError` when try to expose reserved words: `params`, and `flash`.
2016-07-22 17:31:45 +00:00
## v0.7.0 - 2016-07-22
2022-07-11 19:43:39 +00:00
### Added
2022-07-11 19:43:39 +00:00
- [Luca Guidi] Introduced `Hanami::Action::Params#error_messages` which returns a flat collection of full error messages
2016-07-06 13:57:15 +00:00
### Fixed
2022-07-11 19:43:39 +00:00
2016-07-06 13:57:15 +00:00
- [Luca Guidi] Params are deeply symbolized
- [Artem Nistratov] Send only changed cookies in HTTP response
2016-02-08 09:14:01 +00:00
### Changed
2022-07-11 19:43:39 +00:00
- [Luca Guidi] Drop support for Ruby 2.0 and 2.1. Official support for JRuby 9.0.5.0+.
2016-07-06 13:57:15 +00:00
- [Luca Guidi] Param validations now require you to add `hanami-validations` in `Gemfile`.
- [Luca Guidi] Removed "_indifferent access_" for params. Since now on, only symbols are allowed.
- [Luca Guidi] Params are immutable
- [Luca Guidi] Params validations syntax has changed
- [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.
- [Vasilis Spilka] Made `Hanami::Action::Session#errors` public
2016-02-08 09:14:01 +00:00
2016-02-05 16:47:55 +00:00
## v0.6.1 - 2016-02-05
2022-07-11 19:43:39 +00:00
2016-02-05 16:47:55 +00:00
### Changed
2022-07-11 19:43:39 +00:00
2016-02-05 16:47:55 +00:00
- [Anatolii Didukh] Optimise memory usage by freezing MIME types constant
2016-01-22 18:04:49 +00:00
## v0.6.0 - 2016-01-22
2022-07-11 19:43:39 +00:00
2016-01-22 18:04:49 +00:00
### Changed
2022-07-11 19:43:39 +00:00
2016-01-22 18:04:49 +00:00
- [Luca Guidi] Renamed the project
2016-01-19 09:15:30 +00:00
## v0.5.1 - 2016-01-19
2022-07-11 19:43:39 +00:00
2016-01-19 09:15:30 +00:00
### Fixed
2022-07-11 19:43:39 +00:00
2016-01-22 18:04:49 +00:00
- [Alfonso Uceda] Ensure `rack.session` cookie to not be sent twice when both `Lotus::Action::Cookies` and `Rack::Session::Cookie` are used together
2016-01-19 09:15:30 +00:00
2016-01-07 16:00:50 +00:00
## v0.5.0 - 2016-01-12
2022-07-11 19:43:39 +00:00
2015-12-18 16:31:56 +00:00
### Added
2022-07-11 19:43:39 +00:00
2015-12-18 16:31:56 +00:00
- [Luca Guidi] Reference a raised exception in Rack env's `rack.exception`. Compatibility with exception reporting SaaS.
### Fixed
2022-07-11 19:43:39 +00:00
2015-12-18 16:31:56 +00:00
- [Cainã Costa] Ensure Rack environment to be always available for sessions unit tests
- [Luca Guidi] Ensure superclass exceptions to not shadow subclasses during exception handling (eg. `CustomError` handler will take precedence over `StandardError`)
2015-12-18 16:31:56 +00:00
### Changed
2022-07-11 19:43:39 +00:00
2016-01-22 18:04:49 +00:00
- [Luca Guidi] Removed `Lotus::Controller::Configuration#default_format`
- [Cainã Costa] Made `Lotus::Action#session` a public method for improved unit testing
- [Karim Tarek] Introduced `Lotus::Controller::Error` and let all the framework exceptions to inherit from it.
2015-12-18 16:31:56 +00:00
2015-12-04 11:25:17 +00:00
## v0.4.6 - 2015-12-04
2022-07-11 19:43:39 +00:00
2015-12-04 11:25:17 +00:00
### Added
2022-07-11 19:43:39 +00:00
2016-01-11 17:01:02 +00:00
- [Luca Guidi] Allow to force custom headers for responses that according to RFC shouldn't include them (eg 204). Override `#keep_response_header?(header)` in action
2015-12-04 11:25:17 +00:00
2015-09-29 14:45:30 +00:00
## v0.4.5 - 2015-09-30
2022-07-11 19:43:39 +00:00
2015-09-18 13:21:04 +00:00
### Added
2022-07-11 19:43:39 +00:00
2015-09-18 13:21:04 +00:00
- [Theo Felippe] Added configuration entries: `#default_request_format` and `default_response_format`.
- [Wellington Santos] Error handling to take account of inherited exceptions.
### Changed
2022-07-11 19:43:39 +00:00
2015-09-18 13:21:04 +00:00
- [Theo Felippe] Deprecated `#default_format` in favor of: `#default_request_format`.
2015-06-16 15:31:54 +00:00
## v0.4.4 - 2015-06-23
2022-07-11 19:43:39 +00:00
2015-06-16 15:31:54 +00:00
### Added
2022-07-11 19:43:39 +00:00
2015-06-16 15:31:54 +00:00
- [Luca Guidi] Security protection against Cross Site Request Forgery (CSRF).
### Fixed
2022-07-11 19:43:39 +00:00
2015-06-16 15:31:54 +00:00
- [Matthew Bellantoni] Ensure nested params to be correctly coerced to Hash.
2015-05-22 11:07:08 +00:00
## v0.4.3 - 2015-05-22
2022-07-11 19:43:39 +00:00
2015-05-22 11:07:08 +00:00
### Added
2022-07-11 19:43:39 +00:00
2016-01-22 18:04:49 +00:00
- [Alfonso Uceda Pompa & Luca Guidi] Introduced `Lotus::Action#send_file`
2015-05-22 11:07:08 +00:00
- [Alfonso Uceda Pompa] Set automatically `Expires` option for cookies when it's missing but `Max-Age` is present. Compatibility with old browsers.
## v0.4.2 - 2015-05-15
2022-07-11 19:43:39 +00:00
### Fixed
2022-07-11 19:43:39 +00:00
2016-01-22 18:04:49 +00:00
- [Luca Guidi] Ensure `Lotus::Action::Params#to_h` to return `::Hash` at the top level
2015-05-15 10:52:18 +00:00
## v0.4.1 - 2015-05-15
2022-07-11 19:43:39 +00:00
2015-05-15 10:52:18 +00:00
### Fixed
2022-07-11 19:43:39 +00:00
2015-05-15 10:52:18 +00:00
- [Luca Guidi] Ensure proper automatic `Content-Type` working well with Internet Explorer.
2016-01-22 18:04:49 +00:00
- [Luca Guidi] Ensure `Lotus::Action#redirect_to` to return `::String` for Rack servers compatibility.
2015-05-15 10:52:18 +00:00
### Changed
2022-07-11 19:43:39 +00:00
2015-05-15 10:52:18 +00:00
- [Alfonso Uceda Pompa] Prevent `Content-Type` and `Content-Lenght` to be sent when status code requires no body (eg. `204`).
2022-07-11 19:43:39 +00:00
This is for compatibility with `Rack::Lint`, not with RFC 2016.
2016-01-22 18:04:49 +00:00
- [Luca Guidi] Ensure `Lotus::Action::Params#to_h` to return `::Hash`
2015-05-15 10:52:18 +00:00
2015-03-20 15:32:43 +00:00
## v0.4.0 - 2015-03-23
2022-07-11 19:43:39 +00:00
2015-03-20 15:32:43 +00:00
### Added
2022-07-11 19:43:39 +00:00
2015-03-20 15:32:43 +00:00
- [Erol Fornoles] `Action.use` now accepts a block
2016-01-22 18:04:49 +00:00
- [Alfonso Uceda Pompa] Introduced `Lotus::Controller::Configuration#cookies` as default cookie options.
- [Alfonso Uceda Pompa] Introduced `Lotus::Controller::Configuration#default_headers` as default HTTP headers to return in all the responses.
- [Luca Guidi] Introduced `Lotus::Action::Params#get` as a safe API to access nested params.
2015-03-20 15:32:43 +00:00
### Changed
2022-07-11 19:43:39 +00:00
2015-03-20 15:32:43 +00:00
- [Alfonso Uceda Pompa] `redirect_to` now is a flow control method: it terminates the execution of an action, including the callbacks.
2015-01-29 10:50:43 +00:00
## v0.3.2 - 2015-01-30
2022-07-11 19:43:39 +00:00
2015-01-29 10:50:43 +00:00
### Added
2022-07-11 19:43:39 +00:00
2015-01-30 08:05:28 +00:00
- [Alfonso Uceda Pompa] Callbacks: introduced `append_before` (alias of `before`), `append_after` (alias of `after`), `prepend_before` and `prepend_after`.
2016-01-22 18:04:49 +00:00
- [Alfonso Uceda Pompa] Introduced `Lotus::Action::Params#raw` which returns unfiltered data as it comes from an HTTP request.
- [Alfonso Uceda Pompa] `Lotus::Action::Rack.use` now fully supports Rack middleware, by mounting an internal `Rack::Builder` instance.
- [Simone Carletti] `Lotus::Action::Throwable#halt` now accepts an optional message. If missing it falls back to the corresponding HTTP status message.
2015-01-29 10:50:43 +00:00
- [Steve Hodgkiss] Nested params validation
### Fixed
2022-07-11 19:43:39 +00:00
2015-01-29 10:50:43 +00:00
- [Luca Guidi] Ensure HEAD requests will return empty body
- [Stefano Verna] Ensure HTTP status codes with empty body won't send body and non-entity headers.
- [Luca Guidi] Only dump exceptions in `rack.errors` if handling is turned off, or the raised exception is not managed.
- [Luca Guidi] Ensure params will return coerced values
2015-01-08 14:36:12 +00:00
## v0.3.1 - 2015-01-08
2022-07-11 19:43:39 +00:00
2015-01-07 14:09:44 +00:00
### Added
2022-07-11 19:43:39 +00:00
2016-01-22 18:04:49 +00:00
- [Lasse Skindstad Ebert] Introduced `Action#request` which returns an instance a `Rack::Request` compliant object: `Lotus::Action::Request`.
2015-01-07 14:09:44 +00:00
2015-01-08 14:36:12 +00:00
### Fixed
2022-07-11 19:43:39 +00:00
2015-01-08 14:36:12 +00:00
- [Steve Hodgkiss] Ensure params to return coerced values
2014-12-19 09:42:23 +00:00
## v0.3.0 - 2014-12-23
2022-07-11 19:43:39 +00:00
2014-12-19 09:42:23 +00:00
### Added
2022-07-11 19:43:39 +00:00
2014-12-19 09:42:23 +00:00
- [Luca Guidi] Introduced `Action#request_id` as unique identifier for an incoming HTTP request
2016-01-22 18:04:49 +00:00
- [Luca Guidi] Introduced `Lotus::Controller.load!` as loading framework entry point
2014-12-19 09:42:23 +00:00
- [Kir Shatrov] Allow to define a default charset (`default_charset` configuration)
- [Kir Shatrov] Automatic content type with charset (eg `Content-Type: text/html; charset=utf-8`)
- [Michał Krzyżanowski] Allow to specify custom exception handlers: procs or methods (`exception_handler` configuration)
- [Karl Freeman & Lucas Souza] Introduced HTTP caching (`Cache-Control`, `Last-Modified`, ETAG, Conditional GET, expires)
- [Satoshi Amemiya] Introduced `Action::Params#to_h` and `#to_hash`
- [Luca Guidi] Added `#params` and `#errors` as default exposures
- [Luca Guidi] Introduced complete params validations
- [Luca Guidi & Matthew Bellantoni] Allow to whitelist params
- [Luca Guidi & Matthew Bellantoni] Allow to define custom classes for params via `Action.params`
- [Krzysztof Zalewski] Introduced `Action#format` as query method to introspect the requested mime type
- [Luca Guidi] Official support for Ruby 2.2
### Changed
2022-07-11 19:43:39 +00:00
2014-12-19 09:42:23 +00:00
- [Trung Lê] Renamed `Configuration#modules` to `#prepare`
- [Luca Guidi] Update HTTP status codes to IETF RFC 7231
2016-01-22 18:04:49 +00:00
- [Luca Guidi] When `Lotus::Controller` is included, don't inject code
2014-12-19 09:42:23 +00:00
- [Luca Guidi] Removed `Controller.action` as a DSL to define actions
- [Krzysztof Zalewski] Removed `Action#content_type` in favor of `#format=` which accepts a symbol (eg. `:json`)
- [Fuad Saud] Reduce method visibility where possible (Ruby `private` and `protected`)
### Fixed
2022-07-11 19:43:39 +00:00
2014-12-19 09:42:23 +00:00
- [Luca Guidi] Don't let exposures definition to override existing methods
## v0.2.0 - 2014-06-23
2022-07-11 19:43:39 +00:00
2014-12-19 09:42:23 +00:00
### Added
2022-07-11 19:43:39 +00:00
2014-12-19 09:42:23 +00:00
- [Luca Guidi] Introduced `Controller.configure` and `Controller.duplicate`
- [Luca Guidi] Introduced `Action.use`, that let to use a Rack middleware as a before callback
2022-07-11 19:43:39 +00:00
[Luca Guidi] Allow to define a default mime type when the request is `Accept: */*` (`default_format` configuration)
[Luca Guidi] Allow to register custom mime types and associate them to a symbol (`format` configuration)
2014-12-19 09:42:23 +00:00
- [Luca Guidi] Introduced `Configuration#handle_exceptions` to associate exceptions to HTTP statuses
- [Damir Zekic] Allow developers to toggle exception handling (`handle_exceptions` configuration)
- [Luca Guidi] Introduced `Controller::Configuration`
- [Luca Guidi] Official support for Ruby 2.1
### Changed
2022-07-11 19:43:39 +00:00
2016-01-22 18:04:49 +00:00
- [Luca Guidi] `Lotus::Action::Params` doesn't inherit from `Lotus::Utils::Hash` anymore
- [Luca Guidi] `Lotus::Action::CookieJar` doesn't inherit from `Lotus::Utils::Hash` anymore
2014-12-19 09:42:23 +00:00
- [Luca Guidi] Make HTTP status messages compliant with IANA and Rack
- [Damir Zekic] Moved `#throw` override logic into `#halt`, which keeps the same semantic
### Fixed
2022-07-11 19:43:39 +00:00
2014-12-19 09:42:23 +00:00
- [Krzysztof Zalewski] Reference exception in `rack.errors`
## v0.1.0 - 2014-02-23
2022-07-11 19:43:39 +00:00
2014-12-19 09:42:23 +00:00
### Added
2022-07-11 19:43:39 +00:00
2014-12-19 09:42:23 +00:00
- [Luca Guidi] Introduced `Action.accept` to whitelist accepted mime types
- [Luca Guidi] Introduced `Action#accept?` as a query method for the current request
- [Luca Guidi] Allow to whitelist handled exceptions and associate them to an HTTP status
- [Luca Guidi] Automatic `Content-Type`
- [Luca Guidi] Use `throw` as a control flow which understands HTTP status
- [Luca Guidi] Introduced opt-in support for HTTP/Rack cookies
- [Luca Guidi] Introduced opt-in support for HTTP/Rack sessions
- [Luca Guidi] Introduced HTTP redirect API
- [Luca Guidi] Introduced callbacks for actions: before and after
- [Luca Guidi] Introduced exceptions handling with HTTP statuses
- [Luca Guidi] Introduced exposures
- [Luca Guidi] Introduced basic actions compatible with Rack
- [Luca Guidi] Official support for Ruby 2.0