Open TheNorthMemory opened 2 years ago
Thanks for the report.
Related: uri-templates/uritemplate-test#41.
Copy that. I've also strange that the RFC6570 wasn't any samples about double pct-encode.
It sugguest that this library should be followed the RFC3986 Implementations must not
percent-encode or decode the same string more than once. If upgrading with this suggestion, it may works well with Guzzle\Psr7\Uri::filterPath
(https://github.com/guzzle/psr7/blob/2.5/src/Uri.php#L693-L697)
If you have any time to prepare a PR, or half of a PR, that would be much appreciated. I am spread thin these days, lol.
PHP version: 8.1.3
Description
As of a community reporting, while the uri was already contains the
pct-encoded
(reserved characters) component, eg:AIO%2FFR
. The{+var}
syntax is explained this one as ofAIO%252FFR
. It is leading to misinterpreting the original percent data octet string.I've also checked the RFC3986 and RFC6570 specifications.
RFC3986
2.4. When to Encode or Decode
was mentioned there:RFC6570
3.2.1. Variable Expansion
was mentioned there:The pct-encoded reserved character(
%2F
) may pass through but it was encoded the char(%
) to%25
. It is mismatched the specs.How to reproduce
Possible Solution
Additional context