Skip to content

Percent encode set that encodes $ as %24? #353

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

Closed
golddranks opened this issue Jun 5, 2017 · 1 comment
Closed

Percent encode set that encodes $ as %24? #353

golddranks opened this issue Jun 5, 2017 · 1 comment

Comments

@golddranks
Copy link

golddranks commented Jun 5, 2017

I'm using rust-url to percent encode the username and password in my postgresql://username:password@domain/dbname style URL. However, my password contains a special character $, and no one of the percent encoding sets provided by this crate seems to encode that.

$ is considered a "Reserved Character" ( https://tools.ietf.org/html/rfc3986#section-2.2 ), so I think it should be reasonable to encode it when it isn't used as a delimiter. I don't know of any current use of it as a delimiter in URLs, but the libpq that parses the URL complains about it, and accepts the password only as fully encoded.

Maybe there could be a STRICT_ENCODE_SET that would encode each of the reserved characters:

  reserved    = gen-delims / sub-delims

  gen-delims  = ":" / "/" / "?" / "#" / "[" / "]" / "@"

  sub-delims  = "!" / "$" / "&" / "'" / "(" / ")"
              / "*" / "+" / "," / ";" / "="
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