Open dakujem opened 1 year ago
I believe that this is solved by https://github.com/slimphp/Slim-Psr7/pull/190
Yeah... an acceptable compromise.
The opt-in approach would have been better though. This still forces users to enumerate all of the schemas beforehand, which is not usable in generic scenarios like the one I describe above.
Good point. Reopening as we can do better.
Would you accept a PR or is someone else going to work on this? I can't promise to meet any deadline though :-)
Would definitely accept a PR, but can't promise how quickly I can look at it :)
URIs are universal. I assumed that the implementation of
Uri
object would be too.TLDR; The following snippet produces
InvalidArgumentException: Uri scheme must be one of: "", "http", "https"
exception because of scheme filtering inUri::filterScheme
.Reasoning
I tried using Slim/Psr7 for handling generic URIs that I'm using for DSN-style configuration variables.
There are plenty of valid schemes, so setting
Uri::SUPPORTED_SCHEMES
is impractical for this purpose.Now, Guzzle handles this correctly, as does the native
parse_url
function.Suggested solution
I suggest using opt-in approach: keep Slim/Psr7 universal and activate the filter when booting Slim framework.
I believe you get the idea.