[erlang-questions] http_uri:encode not quoting control characters

Mikl Kurkov mkurkov@REDACTED
Thu Jun 11 22:14:04 CEST 2015


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


RFC3986 (https://www.ietf.org/rfc/rfc3986.txt) 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
I wonder why http_uri behaves like this, is it intentional?

Erlang 17.5.3
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150611/8d85eb70/attachment.htm>

More information about the erlang-questions mailing list