httpheader icon indicating copy to clipboard operation
httpheader copied to clipboard

Improve handling of media type escaping according to RFC 723x

Open lieryan opened this issue 10 years ago • 0 comments

According to Section 3.2.3:

Senders SHOULD NOT escape octets in quoted-strings that do not require escaping (i.e., other than DQUOTE and the backslash octet).

However, currently quote_string() escapes SEPARATOR characters that does not need to be escaped:

>>> print quote_string('test/one two\\ @three')
"test\/one\ two\\\ \@three"

They rather should be:

>>> print quote_string('test/one two\\ @three')
"test/one two\\ @three"

lieryan avatar Jan 21 '15 10:01 lieryan