Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom query parameter without value doesn't work. #264

Open
tricki opened this issue May 15, 2023 · 0 comments
Open

Custom query parameter without value doesn't work. #264

tricki opened this issue May 15, 2023 · 0 comments

Comments

@tricki
Copy link

tricki commented May 15, 2023

I tried to use a custom query string of ?foo (with a name but no value) but when I query it using GraphQL all parameters without a value get removed, even if I also add a hash (e.g. ?foo&bar=1#hash becomes ?bar=1#hash).

I believe the problem comes from the Url::getQuery() method defined in the utils package: https://github.com/sebastian-lenz/craft-utils/blob/main/src/models/Url.php#L136-L139

From my reading of RFC 3986 I don't see that a value is required. It does say this which implies that it's optional:

However, as query components are often used to carry identifying information in the form of "key=value" pairs [...]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant