All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
2.1.0 - 2022-01-08
- New option
attribute()
forContentType
middleware, to save the format name in aServerRequest
attribute #10.
2.0.2 - 2020-12-02
- Support for PHP 8
2.0.1 - 2020-03-07
- If no Accept header field is present, returns the default format instead a
406
response, according to the specs #6, #8
2.0.0 - 2019-11-29
- The array of formats passed to
ContentType
middleware can contain plain values, for examplenew Middlewares\ContentType(['html', 'json'])
, so it's not required to provide the full data for each format (the list of headers, extensions, etc).
- The option
ContentLanguage::redirect()
accepts aResponseFactoryInterface
as argument. - The option
ContentType::errorResponse()
accepts aResponseFactoryInterface
as argument.
- Support for PHP 7.0 and 7.1
- Option
responseFactory
inContentLanguage
andContentType
middlewares
1.1.0 - 2018-08-04
- PSR-17 support
- New option
responseFactory
inContentLanguage
andContentType
middlewares
1.0.0 - 2018-01-25
- Improved testing and added code coverage reporting
- Added tests for PHP 7.2
- Upgraded to the final version of PSR-15
psr/http-server-middleware
- Changed namespace of
Middlewares\NegotiationTrait
(fromMiddlewares\Utils\NegotiationTrait
)
- Updated license year
0.5.0 - 2017-11-13
- Replaced
http-interop/http-middleware
withhttp-interop/http-server-middleware
.
- Removed support for PHP 5.x.
0.4.0 - 2017-09-21
- ContentType: New static function
ContentType::getDefaultFormats()
that returns the default formats used. - ContentType: New option
useDefault
option to enable/disable the default format. By default is enabled. If it's disabled, a 406 response is returned when no content-type is found.
- Append
.dist
suffix to phpcs.xml and phpunit.xml files - Changed the configuration of phpcs and php_cs
- Upgraded phpunit to the latest version and improved its config file
- ContentType: Removed the
defaultFormat
option and use always the first element in the formats list.
0.3.1 - 2017-05-18
- Added
kml
to the list of the default formats
0.3.0 - 2016-12-26
- New method
ContentType::charsets()
to define the available charsets and negotiate theAccept-Charset
header.
- Updated tests
- Updated to
http-interop/http-middleware#0.4
- Updated
friendsofphp/php-cs-fixer#2.0
- Only text-based formats (html, text, css, etc) adds the
charset=[charset]
sufix toContent-Type
header.
0.2.0 - 2016-11-22
- New
ContentType::noSniff()
option to add theX-Content-Type-Options: nosniff
header (enabled by default)
- Updated to
http-interop/http-middleware#0.3
- ContentEncoding middleware removes the
Accept-Encoding
header if it does not match with any available option.
0.1.0 - 2016-10-01
First version