Skip to content

Releases: laminas/laminas-diactoros

2.13.0

07 Jul 12:31
2.13.0
34ba650
Compare
Choose a tag to compare

Release Notes for 2.13.0

Feature release (minor)

2.13.0

  • Total issues resolved: 0
  • Total pull requests resolved: 4
  • Total contributors: 3

Enhancement

renovate

2.12.0

06 Jul 11:45
2.12.0
Compare
Choose a tag to compare

Release Notes for 2.12.0

Feature release (minor)

2.12.0

  • Total issues resolved: 0
  • Total pull requests resolved: 5
  • Total contributors: 4

Bug

Enhancement

Documentation,Enhancement

2.11.3

06 Jul 09:26
2.11.3
1f97b0c
Compare
Choose a tag to compare

Release Notes for 2.11.3

2.11.x bugfix release (patch)

2.11.3

  • Total issues resolved: 0
  • Total pull requests resolved: 1
  • Total contributors: 1

Bug,Enhancement

2.11.2

29 Jun 14:15
2.11.2
78846cb
Compare
Choose a tag to compare

Release Notes for 2.11.2

2.11.x bugfix release (patch)

2.11.2

  • Total issues resolved: 0
  • Total pull requests resolved: 1
  • Total contributors: 1

Bug

2.11.1

28 Jun 21:41
2.11.1
25b11d4
Compare
Choose a tag to compare

Release Notes for 2.11.1

This is a SECURITY release. All users are encouraged to upgrade immediately.

Added

This release adds features to allow filtering a ServerRequest as generated by Laminas\Diactoros\ServerRequestFactory::fromGlobals() for the purposes of initialization. Examples include:

  • Adding a request identifier.
  • Using X-Forwarded-* headers to modify the URL to represent the original client request.

The features are based on a new interface, Laminas\Diactorors\ServerRequestFilter\FilterServerRequestInterface, which defines a single method:

public function __invoke(
    \Psr\Http\Message\ServerRequestInterface $request
): \Psr\Http\Message\ServerRequestInterface

We provide two implementations, as follows:

  • Laminas\Diactoros\ServerRequestFilter\DoNotFilter will return the provided request verbatim.
  • Laminas\Diactoros\ServerRequestFilter\FilterUsingXForwardedHeaders has named constructors that allow you to define how and when X-Forwarded-* headers are used to modify the URI instance associated with the request. These methods are:
    • trustAny(): this method generates a filter instance that will trust all X-Forwarded-* headers from any source.
    • trustReservedSubnets(array $trustedHeaders = ?): this method generates a filter instance that only modifies the URL if the IP address of the requesting server is from a reserved, private subnet (localhost; classes A, B, and C subnets; and IPv6 private and local-link subnets). By default, it will trust all X-Forwarded-* headers from these sources, but you may specify a list to allow via the $trustedHeaders argument.
    • trustProxies(array $proxyCIDRList, array $trustedHeaders = ?): this method will generate a filter instance that only modifies the URL if the requesting server matches an entry in the $proxyCIDRList. These entries may be IP addresses, or any IPv4 or IPv6 CIDR subnets. By default, it will trust all X-Forwarded-* headers from these sources, but you may specify a list to allow via the $trustedHeaders argument.

ServerRequestFactory::fromGlobals() now accepts a FilterServerRequestInterface instance as the optional argument $requestFilter. If none is provided, it uses one as produced by FilterUsingXForwardedHeaders::trustReservedSubnets().

Deprecated

  • The function Laminas\Diactoros\marshalUriFromSapi() is deprecated, and no longer used internally.

Changed

Laminas\Diactoros\ServerRequestFactory::fromGlobals() no longer consumes marshalUriFromSapi(), and instead inlines an alternate implementation. The new implementation does not consider X-Forwarded-* headers by default when generating the associated URI instance. Internally, if no FilterServerRequestInterface implementation is provided, it defaults to using an instance returned by FilterUsingXForwardeHeaders::trustReservedSubnets(). If you previously relied on X-Forwarded-* headers, you MAY need to update your code to use either the FilterUsingXForwardedHeaders::trustAny() or FilterUsingXForwardedHeaders::trustProxies() methods to generate a filter to use with ServerRequestFactory::fromGlobals().

Fixed

2.11.1

  • Total issues resolved: 0
  • Total pull requests resolved: 0
  • Total contributors: 0

2.11.0

17 May 10:58
2.11.0
d1bc565
Compare
Choose a tag to compare

Release Notes for 2.11.0

Feature release (minor)

2.11.0

  • Total issues resolved: 0
  • Total pull requests resolved: 2
  • Total contributors: 1

Enhancement

2.10.0

04 May 15:18
2.10.0
a3f03b3
Compare
Choose a tag to compare

Release Notes for 2.10.0

Changed

This release adds minor normalization of header values with line continuations; the line continuations are now normalized to a single space. This is done to conform to RFC 7230#3.2.4, which is an important security guideline.

2.10.0

  • Total issues resolved: 0
  • Total pull requests resolved: 5
  • Total contributors: 2

Enhancement

Bug,Enhancement

Bug

2.9.2

06 Apr 17:38
2.9.2
07475df
Compare
Choose a tag to compare

Release Notes for 2.9.2

2.9.x bugfix release (patch)

2.9.2

  • Total issues resolved: 0
  • Total pull requests resolved: 1
  • Total contributors: 1

Bug

2.9.1

06 Apr 16:18
2.9.1
736ba5c
Compare
Choose a tag to compare

Release Notes for 2.9.1

2.9.x bugfix release (patch)

2.9.1

  • Total issues resolved: 0
  • Total pull requests resolved: 1
  • Total contributors: 1

Bug

2.9.0

29 Mar 20:13
2.9.0
954e2dc
Compare
Choose a tag to compare

Release Notes for 2.9.0

2.9.0

  • Total issues resolved: 1
  • Total pull requests resolved: 4
  • Total contributors: 4

Enhancement

Documentation,Enhancement,hacktoberfest-accepted