| Q | A
| --------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | yes
| Deprecations? | no
| Related tickets | -
| Documentation | -
| License | MIT
What's in this PR?
PR is primarily context to explain proposal to remove Zend UriFactory support.
The Zend UriFactory is not PSR-17 compliant in the way that it generates it's URIs.
$uri = new \Zend\Diactoros\Uri('testing');
$this->assertEquals('testing', (string) $uri);
This test case would fail as the resulting Uri will actually be
/ is an assumption which has consequences - mentioned on
* Normally, the empty path "" and absolute path "/" are considered equal as
* defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically
* do this normalization because in contexts with a trimmed base path, e.g.
* the front controller, this difference becomes significant. It's the task
* of the user to handle both "" and "/".
More info here:
As this UriFactory is prepending a
/ and not allowing the user to handle both
"/", different UriFactories can not be used interchangeably - preventing Liskov Substitution principle here.
Recently this caused us an issue where in many of our services, our new client operated as expected - primarily using versions of Guzzle. However, the Zend UriFactory was used in one of our legacy systems. Since our services have a path as part of their base_uri, this was stripped and our URIs were malformed due to prepending
/ - we addressed this issue by using league/uri.
- [ ] Updated CHANGELOG.md to describe BC breaks / deprecations | new feature | bugfix
- [ ] Documentation pull request created (if not simply a bugfix)
- [ ] The checklist above - primarily raising the PR to first discuss the approach and gain feedback