Closed jdp closed 7 years ago
This seems harmless....
If anyone else can comment on this, would be much appreciated.
If there's anything I've learned from Requests, it's never touch URL encoding unless you know you need to.
This patch looks like the correct thing to do.
Percent-encoding is allowed in URI hosts per RFC 3986, provided that the host is intended to be interpreted as UTF-8:
reg-name = *( unreserved / pct-encoded / sub-delims ) ... URI producing applications must not use percent-encoding in host unless it is used to represent a UTF-8 character sequence.
The newer URL Standard tightens up the character restrictions in hosts in URL's though. Hosts can still be percent-encoded, but fail to parse if any restricted characters are still present after decoding:
If asciiDomain contains U+0000, U+0009, U+000A, U+000D, U+0020, "#", "%", "/", ":", "?", "@", "[", "\", or "]", syntax violation, return failure.
I wouldn't be against changing the URL format to cloudsql:/cloudsql/project-id:instance-id?username=&password=&database=
or something.
needs a rebase!
Adds support for other special characters in UNIX socket path names, like the colons in Cloud SQL paths.
See also: https://github.com/kennethreitz/dj-database-url/issues/66