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

Represented Blank Url-Encoded Parameters by only their Key in the Query String #186

Merged
merged 18 commits into from
May 24, 2018

Conversation

grahammendick
Copy link
Owner

Can turn url of a?x=true into a?x by returning '' from urlEncode for parameter key x

Don't want to pass null (or undefined) to decode because decodeURIComponent(null) is 'null'. If someone forgot to put a matching decode for the blank encode then would end up with a value of 'null' and confusion. With '' you'd realise you hadn't decoded the blank.
Plus a query stirng of ?a is handled the same as ?a= Can't generate the second one but it could be passed in
Routes params can't accept blank encoded values. There's no way to tell if the value is blank because it's encoded as blank or just not provided. In the first case want to call decode but not in the second
@grahammendick grahammendick merged commit 68692f6 into master May 24, 2018
@grahammendick grahammendick deleted the blank-encode branch May 24, 2018 12:24
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

Successfully merging this pull request may close these issues.

1 participant