zendframework/zend-http
Zend\Http is a PHP HTTP component for building and processing HTTP messages. It provides clients and adapters for making requests, plus request/response objects, headers, cookies, and utilities to work with URIs and HTTP-level features in your apps.
#175 adds support for Content Security Policy Level 3 Header directives.
#200 adds support for additional directives in Content Security Policy header:
block-all-mixed-content,require-sri-for,trusted-types,upgrade-insecure-requests.#177 adds support for Feature Policy header.
#186 adds support for SameSite directive in Set-Cookie header.
ContentSecurityPolicy to allow multiple values. Before it was not possible to provide multiple headers of that type.#184 fixes responses for request through the proxy with HTTP/1.1 200 Connection established header.
#187 fixes infinite recursion on invalid header. Now InvalidArgumentException exception is thrown.
#188 fixes Client::setCookies method to properly handle array of SetCookie objects. Per documentation it should be allowed.
#189 fixes Headers::toArray method to properly handle headers of the same type. Behaviour was different depends how header has been attached (addHeader or addHeaderLine broken before).
#198 fixes merging options in Curl adapter. It was not possible to override integer-key options (constants) set via constructor with method setOptions.
#198 fixes allowed options type in Proxy::setOptions. Traversable, array or Zend\Config object is expected.
#198 fixes various issues with Proxy adapter.
#199 fixes saving resource to the file when streaming while client supports compression. Before, incorrectly, compressed resource was saved into the file.
Curl and
Socket client adapters; it now correctly identifies both integer and string
integer values.Curl and
Socket client adapters; it now correctly identifies both integer and string
integer values.#154 adds the method SetCookie::setEncodeValue(). By default, Set-Cookie
values are passed through urlencode(); when a boolean false is provided to
this new method, the raw value will be used instead.
#166 adds support for PHP 7.3.
#154 changes the behavior of SetCookie::fromString() slightly: if the parsed
cookie value is the same as the one passed through urldecode(), the
SetCookie header's $encodeValue property will be toggled off to ensure the
value is not encoded in subsequent serializations, thus retaining the
integrity of the value between usages.
#161 changes how the Socket and Test adapters aggregate headers. Previously,
they would ucfirst() the header name; now, they correctly leave the header
names untouched, as header names should be considered case-insensitive.
#156 changes how gzip and deflate decompression occur in responses, ensuring that if the Content-Length header reports 0, no decompression is attempted, and an empty string is returned.
#165 fixes detection of the base URL when operating under a CLI environment.
#149 provides fixes to Client::setUri() to ensure its status as a relative
or absolute URI is correctly memoized.
#162 fixes a typo in an exception message raised within Cookies::fromString().
#121 adds detection for non-numeric connection timeout values as well as integer casting to ensure the timeout is set properly in both the Curl and Socket adapters.
Zend\Http\Exception\InvalidArgumentException
in such cases. This change ensures the behavior is consistent with behavior
prior to the 2.8.0 release.This release modifies how Zend\Http\PhpEnvironment\Request marshals the
request URI. In prior releases, we would attempt to inspect the
X-Rewrite-Url and X-Original-Url headers, using their values, if present.
These headers are issued by the ISAPI_Rewrite module for IIS (developed by
HeliconTech). However, we have no way of guaranteeing that the module is what
issued the headers, making it an unreliable source for discovering the URI. As
such, we have removed this feature in this release of zend-http.
If you are developing a zend-mvc application, you can mimic the functionality by adding a bootstrap listener like the following:
public function onBootstrap(MvcEvent $mvcEvent)
{
$request = $mvcEvent->getRequest();
$requestUri = null;
$httpXRewriteUrl = $request->getHeader('X-Rewrite-Url');
if ($httpXRewriteUrl) {
$requestUri = $httpXRewriteUrl->getFieldValue();
}
$httpXOriginalUrl = $request->getHeader('X-Original-Url');
if ($httpXOriginalUrl) {
$requestUri = $httpXOriginalUrl->getFieldValue();
}
if ($requestUri) {
$request->setUri($requestUri)
}
}
If you use a listener such as the above, make sure you also instruct your web server to strip any incoming headers of the same name so that you can guarantee they are issued by the ISAPI_Rewrite module.
#135 adds a package suggestion of paragonie/certainty, which provides automated management of cacert.pem files.
#143 adds support for PHP 7.2.
#140 fixes retrieval of headers when multiple headers of the same name
are added to the Headers instance; it now ensures that the last header added of the same
type is retrieved when it is not a multi-value type. Previous values are overwritten.
#112 provides performance improvements when parsing large chunked messages.
introduces changes to Response::fromString() to pull the next line of the response
and parse it for the status when a 100 status code is initially encountered, per https://tools.ietf.org/html/rfc7231#section-6.2.1
#122 fixes an issue with the stream response whereby if the outputstream
option is set, the output file was opened twice; it is now opened exactly once.
#147 fixes an issue with header retrieval when the header line is malformed.
Previously, an exception would be raised if a specific HeaderInterface implementation determined
the header line was invalid. Now, Header::has() will return false for such headers, allowing
Request::getHeader() to return false or the provided default value. Additionally, in cases
where the header name is malformed (e.g., Useragent instead of User-Agent, users can still
retrieve by the submitted header name; they will receive a GenericHeader instance in such
cases, however.
#133 Adds back missing sprintf placeholder in CacheControl exception message
Expires header to allow values of 0 or '0'; these now resolve
to the start of the unix epoch (1970-01-01).none (empty value).arg_separator
for application/x-www-form-urlencoded submissions.ContentLength constructor to test for a non null value (vs a falsy value) before validating the value; this ensures 0 values may be specified for the length.How can I help you explore Laravel packages today?