Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Diactoros 1.1.0

Compare
Choose a tag to compare
@weierophinney weierophinney released this 24 Jun 20:50
· 1171 commits to master since this release

Added

  • #52, #58, #59, and #61 create several custom response types for simplifying response creation:

    • Zend\Diactoros\Response\HtmlResponse accepts HTML content via its constructor, and sets the Content-Type to text/html.
    • Zend\Diactoros\Response\JsonResponse accepts data to serialize to JSON via its constructor, and sets the Content-Type to application/json.
    • Zend\Diactoros\Response\EmptyResponse allows creating empty, read-only responses, with a default status code of 204.
    • Zend\Diactoros\Response\RedirectResponse allows specifying a URI for the Location header in the constructor, with a default status code of 302.

    Each also accepts an optional status code, and optional headers (which can also be used to provide an alternate Content-Type in the case of the HTML and JSON responses).

Deprecated

  • Nothing.

Removed

  • #43 removed both ServerRequestFactory::marshalUri() and ServerRequestFactory::marshalHostAndPort(), which were deprecated prior to the 1.0 release.

Fixed

  • #29 fixes request method validation to allow any valid token as defined by RFC 7230. This allows usage of custom request methods, vs a static, hard-coded list.