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.
- Properly handle the fact that PHP transforms numeric strings in array keys to ints
- Updated the mime type map to add some new entries, fix a couple of invalid entries, and remove an invalid entry
- Fallback to
application/octet-stream
if we are unable to guess the content type for a multipart file upload
- Corrected mime type for
.acc
files toaudio/aac
- PHP 8.3 support
- Adjusted
psr/http-message
version constraint to^1.1 || ^2.0
- Prevent possible warnings on unset variables in
ServerRequest::normalizeNestedFileSpec
- Fixed
Message::bodySummary
whenpreg_match
fails - Fixed header validation issue
- Removed the need for
AllowDynamicProperties
inLazyOpenStream
- Replaced
sha1(uniqid())
bybin2hex(random_bytes(20))
- Fixed erroneous behaviour when combining host and relative path
- Rewind body before reading in
Message::bodySummary
- Added provisional PHP 8.2 support
- Added
UriComparator::isCrossOrigin
method
- Added
Header::splitList
method - Added
Utils::tryGetContents
method - Improved
Stream::getContents
method - Updated mimetype mappings
- Fix
Message::parseRequestUri
for numeric headers - Re-wrap exceptions thrown in
fread
into runtime exceptions - Throw an exception when multipart options is misformatted
- Correct header value validation
- A more compressive list of mime types
- Add JsonSerializable to Uri
- Missing return types
- Bug MultipartStream no
uri
metadata - Bug MultipartStream with filename for
data://
streams - Fixed new line handling in MultipartStream
- Reduced RAM usage when copying streams
- Updated parsing in
Header::normalize()
- Validate header values properly
- Attempting to create a
Uri
object from a malformed URI will no longer throw a genericInvalidArgumentException
, but rather aMalformedUriException
, which inherits from the former for backwards compatibility. Callers relying on the exception being thrown to detect invalid URIs should catch the new exception.
- Return
null
in caching stream size if remote size isnull
Identical to the RC release.
- Handle possibly unset
url
instream_get_meta_data
- PSR-17 factories
- Made classes final
- PHP7 type hints
- When building a query string, booleans are represented as 1 and 0.
- PHP < 7.2 support
- All functions in the
GuzzleHttp\Psr7
namespace
- Issue parsing IPv6 URLs
- Issue modifying ServerRequest lost all its attributes
- Locale independent URL parsing
- Most classes got a
@final
annotation to prepare for 2.0
- Issue when creating stream from
php://input
and curl-ext is not installed - Broken
Utils::tryFopen()
on PHP 8
- Replaced functions by static methods
- Converting a non-seekable stream to a string
- Handle multiple Set-Cookie correctly
- Ignore array keys in header values when merging
- Allow multibyte characters to be parsed in
Message:bodySummary()
- Restored partial HHVM 3 support
- Accept null and bool header values again
1.6.0 - 2019-06-30
- Allowed version
^3.0
ofralouphie/getallheaders
dependency (#244) - Added MIME type for WEBP image format (#246)
- Added more validation of values according to PSR-7 and RFC standards, e.g. status code range (#250, #272)
- Tests don't pass with HHVM 4.0, so HHVM support got dropped. Other libraries like composer have done the same. (#262)
- Accept port number 0 to be valid (#270)
- Fixed subsequent reads from
php://input
in ServerRequest (#247) - Fixed readable/writable detection for certain stream modes (#248)
- Fixed encoding of special characters in the
userInfo
component of an URI (#253)
1.5.2 - 2018-12-04
- Check body size when getting the message summary
1.5.1 - 2018-12-04
- Get the summary of a body only if it is readable
1.5.0 - 2018-12-03
- Response first-line to response string exception (fixes #145)
- A test for #129 behavior
get_message_body_summary
function in order to get the message summary3gp
andmkv
mime types
- Clarify exception message when stream is detached
- Deprecated parsing folded header lines as per RFC 7230
- Fix
AppendStream::detach
to not close streams InflateStream
preservesisSeekable
attribute of the underlying streamServerRequest::getUriFromGlobals
to support URLs in query parameters
Several other fixes and improvements.
1.4.2 - 2017-03-20
- Reverted BC break to
Uri::resolve
andUri::removeDotSegments
by removing calls totrigger_error
when deprecated methods are invoked.
1.4.1 - 2017-02-27
- Rriggering of silenced deprecation warnings.
- Reverted BC break by reintroducing behavior to automagically fix a URI with a relative path and an authority by adding a leading slash to the path. It's only deprecated now.
1.4.0 - 2017-02-21
- Added common URI utility methods based on RFC 3986 (see documentation in the readme):
Uri::isDefaultPort
Uri::isAbsolute
Uri::isNetworkPathReference
Uri::isAbsolutePathReference
Uri::isRelativePathReference
Uri::isSameDocumentReference
Uri::composeComponents
UriNormalizer::normalize
UriNormalizer::isEquivalent
UriResolver::relativize
- Ensure
ServerRequest::getUriFromGlobals
returns a URI in absolute form. - Allow
parse_response
to parse a response without delimiting space and reason. - Ensure each URI modification results in a valid URI according to PSR-7 discussions.
Invalid modifications will throw an exception instead of returning a wrong URI or
doing some magic.
(new Uri)->withPath('foo')->withHost('example.com')
will throw an exception because the path of a URI with an authority must start with a slash "/" or be empty(new Uri())->withScheme('http')
will return'http://localhost'
Uri::resolve
in favor ofUriResolver::resolve
Uri::removeDotSegments
in favor ofUriResolver::removeDotSegments
Stream::read
when length parameter <= 0.copy_to_stream
reads bytes in chunks instead ofmaxLen
into memory.ServerRequest::getUriFromGlobals
whenHost
header contains port.- Compatibility of URIs with
file
scheme and empty host.
1.3.1 - 2016-06-25
Uri::__toString
for network path references, e.g.//example.org
.- Missing lowercase normalization for host.
- Handling of URI components in case they are
'0'
in a lot of places, e.g. as a user info password. Uri::withAddedHeader
to correctly merge headers with different case.- Trimming of header values in
Uri::withAddedHeader
. Header values may be surrounded by whitespace which should be ignored according to RFC 7230 Section 3.2.4. This does not apply to header names. Uri::withAddedHeader
with an array of header values.Uri::resolve
when base path has no slash and handling of fragment.- Handling of encoding in
Uri::with(out)QueryValue
so one can pass the key/value both in encoded as well as decoded form to those methods. This is consistent with withPath, withQuery etc. ServerRequest::withoutAttribute
when attribute value is null.
1.3.0 - 2016-04-13
- Remaining interfaces needed for full PSR7 compatibility (ServerRequestInterface, UploadedFileInterface, etc.).
- Support for stream_for from scalars.
- Can now extend Uri.
- A bug in validating request methods by making it more permissive.
1.2.3 - 2016-02-18
- Support in
GuzzleHttp\Psr7\CachingStream
for seeking forward on remote streams, which can sometimes return fewer bytes than requested withfread
. - Handling of gzipped responses with FNAME headers.
1.2.2 - 2016-01-22
- Support for URIs without any authority.
- Support for HTTP 451 'Unavailable For Legal Reasons.'
- Support for using '0' as a filename.
- Support for including non-standard ports in Host headers.
1.2.1 - 2015-11-02
- Now supporting negative offsets when seeking to SEEK_END.
1.2.0 - 2015-08-15
- Body as
"0"
is now properly added to a response. - Now allowing forward seeking in CachingStream.
- Now properly parsing HTTP requests that contain proxy targets in
parse_request
. - functions.php is now conditionally required.
- user-info is no longer dropped when resolving URIs.
1.1.0 - 2015-06-24
- URIs can now be relative.
multipart/form-data
headers are now overridden case-insensitively.- URI paths no longer encode the following characters because they are allowed in URIs: "(", ")", "*", "!", "'"
- A port is no longer added to a URI when the scheme is missing and no port is present.
Initial release.
Currently unsupported:
Psr\Http\Message\ServerRequestInterface
Psr\Http\Message\UploadedFileInterface