Comments (5)
I think this is because the path you've provided contains invalid characters - you can't use a colon. Replace all the colons with %3A
and it should work.
from psr7.
Browsers render %3A
as :
, which can be confusing, but they actually send %3A
to servers.
from psr7.
Hi, thanks for the swift reply!
Well, it is not invalid according to https://datatracker.ietf.org/doc/html/rfc3986#appendix-A which includes colons for path segments in this scenario. I would expect Uri
to be standards compliant here.
Additionally it's not that colons generally cause this issue. It's only if paired with a number - I guess it's because parse_url
is just not meant for URIs but only full URLs and gets confused by an apparent host / port.
from psr7.
There's not much other option if you want to not pass a valid URI through to the Url class (just the path component of a URI is not a URI). Parse URL is not mis-interpreting it - it just is not meant to be given just a path. ;)
from psr7.
RFC 3986 defines URI and URI reference (but most people probably do not distinguish between them). Since test cases for the Uri
class accept input values consisting only of paths it is already implying to support URI references (which is a superset of URI) I'd say. I couldn't find an explicit definition of this in https://www.php-fig.org/psr/psr-7/ though.
So I would still say this is a bug in the Uri
class because it uses parse_url
behind the scenes (which works okay for most scenarios).
I think we can work around this issue for now, but I wanted to raise this issue for the PSR-7 implementation to be more compliant to the web standard here.
from psr7.
Related Issues (20)
- So, php5.6 can't use secure guzzlehttp anymore? HOT 2
- InvalidArgumentException: \"___utmvaBIBusFowZ=wDn\u0001qsva; path=/; Max-Age=900\" HOT 5
- cant use tryFopen with Swoole + AwsS3sdk and freebsd HOT 1
- Fix for CVE-2022-24775 causes non-standard behavior; appears to break RFC-7230 compliance HOT 4
- Code issue in LimitStream HOT 2
- Relative path with authority part present fails HOT 2
- $response->getBody()->getContents();获取到的值始终为空 HOT 1
- StreamWrapper streams are always seekable HOT 1
- Error when $version parameter is null in Message:parseRequest HOT 8
- PHP 8.2 Deprecated Messages HOT 3
- GuzzleHttp\Psr7\Message::bodySummary() incorrect cut off characters in unicode encoding HOT 1
- Missing typehints HOT 1
- GuzzleHttp\Psr7\Uri Incorrectly filled port, when converted to a string HOT 2
- Message::toString throw error when headers is list array HOT 1
- Content-Type assumption not done if the file don't have extension HOT 4
- $response->getBody()->getContents() returns empty string HOT 4
- "HTTP/2 200 is not valid header value" on 2.5.0 HOT 11
- AAC MimeType has a Typo HOT 5
- Remove ralouphie/getallheaders dependency ? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from psr7.