http_uri:encode not quoting control characters

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

http_uri:encode not quoting control characters

Mikl Kurkov

just figured out that http_uri:encode function doesn't percent-encode control characters, like this:


RFC3986 ( states that:

A percent-encoding mechanism is used to represent a data octet in a
   component when that octet's corresponding character is outside the
   allowed set or is being used as a delimiter of, or within, the

Characters that are allowed in a URI but do not have a reserved
   purpose are called unreserved.  These include uppercase and lowercase
   letters, decimal digits, hyphen, period, underscore, and tilde.

      unreserved  = ALPHA / DIGIT / "-" / "." / "_" / "~"

So it looks like control characters are not allowed in URI and should be encoded.
I wonder why http_uri behaves like this, is it intentional?

Erlang 17.5.3

erlang-questions mailing list
[hidden email]