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

decode URL values #17

Closed
matryer opened this issue Dec 6, 2013 · 5 comments
Closed

decode URL values #17

matryer opened this issue Dec 6, 2013 · 5 comments
Labels

Comments

@matryer
Copy link
Member

matryer commented Dec 6, 2013

?something=one+two+three

Arg("something") should yield `one two three` and not `one+two+three`
@matryer matryer closed this as completed in 8aefbea Dec 6, 2013
matryer pushed a commit that referenced this issue Dec 6, 2013
@alexanderdickson
Copy link

Does this decodeURIComponent() and then apply the replacement? That seems wrong.

Example

?param=some%2bvalue

This decodes to:

some value

I'd argue that's wrong. It should be some+value still.

@wwalser
Copy link
Contributor

wwalser commented May 2, 2014

Alex is right, any encoded url containing a + symbol now gets turned into a space instead of being a plus.

"?username=wes%2b%2b" username is "wes++" not "wes ".
"?username=wes+mcduck" on the other hand is "wes mcduck".

In the code path, you've already decodedURIComponents once when you call __decode.

@alexanderdickson
Copy link

Glad it's not just me :)

@matryer
Copy link
Member Author

matryer commented May 2, 2014

Anyone want to suggest a fix?

On May 2, 2014, at 12:26 AM, Alexander Dickson [email protected] wrote:

Glad it's not just me :)


Reply to this email directly or view it on GitHub.

@wwalser
Copy link
Contributor

wwalser commented May 3, 2014

I'll have a shot at a PR over the weekend.

wwalser added a commit to wwalser/arg.js that referenced this issue May 5, 2014
matryer pushed a commit that referenced this issue May 6, 2014
Resolution to issue #17, plusses in decoded url should remain intact.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants