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

urlEncode doesn't properly handle < 0x10 #65

Closed
unknownbrackets opened this issue Jun 30, 2012 · 1 comment
Closed

urlEncode doesn't properly handle < 0x10 #65

unknownbrackets opened this issue Jun 30, 2012 · 1 comment

Comments

@unknownbrackets
Copy link

When trying to urlEncode a perfectly reasonable string containing newlines (%0a), they are encoded as %a which is incorrect and isn't properly parsed by other clients.

This is also affecting tabs. Other non-printables are probably unlikely to be used in URL encoding.

In my case I was trying to encode a multi-line string to place in a fragment for a link to translate.google.com. When properly encoded it happily accepts these strings.

I suppose the problem is here:
https://github.com/rejectedsoftware/vibe.d/blob/c8a03f93639ada7a307ea7dd3db0db909275a646/source/vibe/textfilter/urlencode.d#L44

-[Unknown]

s-ludwig added a commit that referenced this issue Jul 1, 2012
Added reserve() calls in urlEncode/urlDecode that should improve memory management in certain situations (e.g. for ascii field names and numeric values in query strings).
@s-ludwig
Copy link
Member

s-ludwig commented Jul 1, 2012

Fixed. The %a was not even parsed correctly by urlDecode() (and how should it, of course).

There are also some unit tests now. Reminded me that one big task left for 0.8 is to get a proper test suite and an auto tester up...

@s-ludwig s-ludwig closed this as completed Jul 1, 2012
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

2 participants