-
Notifications
You must be signed in to change notification settings - Fork 46
Description
Description
Hey there,
I recently ran into an issue regarding urlencode of userInfo. Due to whatever reasons, nyholm/psr7 does not encode the password and thus, curl returns error code 3 (malformed URI) when executing a request with a password containing characters which need to be urlencode.
Since nyholm/psr7 did not received any updates for quite a long time, I assume it is either not maintained or the pace of fixing issues reduced. Since there are PSR-17 implementations of industry approved libraries, I am not quite sure why nyholm/psr7 has almost the highest priority when detecting PSR-17 factories.
For example:
guzzle/psr7slim/psr7laminas/diactoros
When it comes to PSR-18, symfony and guzzle have the highest priorities and there are no doubts. I'd expect guzzle to always overrule nyholm/psr7 as well.
Example
$uri = new \Nyholm\Psr7\Uri('http://example.org');
$uri = $uri->withUserInfo('username', 'password#');
echo (string) $uri; // http://username:password#@example.org => when used with curl, curl error 3 malformed uri
$uri = new \GuzzleHttp\Psr7\Uri('http://example.org');
$uri = $uri->withUserInfo('username', 'password#');
echo (string) $uri; // http://username:password%23@example.org => when used with curl, all goodAdditional context
It also seems that @Nyholm is not interested in interoperability of his component.
I just quickly checked PSR7 specification and it does not mention anything about URL encoding.
I see no reason to change unless a PSR is updated with clear guidelines.
When I understand this discovery component correct, it is expected that every discovered PSR-18/PSR-17 implementation does support the same functionality as if not - it won't be interchangeable.
Since in the mentioned comments above the response was "I dont care unless PSR cares" while the authors of the issues stated that other implementations actually do support these (so not just one), I frankly would prefer having nyholm/psr7 either removed or the priority should be lowered so that other components are picked up first.