aboutsummaryrefslogtreecommitdiff
path: root/Misc
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-05-29 04:43:27 -0700
committerGitHub <noreply@github.com>2020-05-29 04:43:27 -0700
commit6381ee077d3c69d2f947f7bf87d8ec76e0caf189 (patch)
treedaa4c61c903d3a39d7ee1b4eb0d118c614f9e7b6 /Misc
parentNote the output ordering of combinatoric functions (GH-19732) (GH-20502) (diff)
downloadcpython-6381ee077d3c69d2f947f7bf87d8ec76e0caf189.tar.gz
cpython-6381ee077d3c69d2f947f7bf87d8ec76e0caf189.tar.bz2
cpython-6381ee077d3c69d2f947f7bf87d8ec76e0caf189.zip
bpo-39040: Fix parsing of email mime headers with whitespace between encoded-words. (gh-17620)
* bpo-39040: Fix parsing of email headers with encoded-words inside a quoted string. It is fairly common to find malformed mime headers (especially content-disposition headers) where the parameter values, instead of being encoded to RFC standards, are "encoded" by doing RFC 2047 "encoded word" encoding, and then enclosing the whole thing in quotes. The processing of these malformed headers was incorrectly leaving the spaces between encoded words in the decoded text (whitespace between adjacent encoded words is supposed to be stripped on decoding). This changeset fixes the encoded word processing inside quoted strings (bare-quoted-string) to do correct RFC 2047 decoding by stripping that whitespace. (cherry picked from commit 21017ed904f734be9f195ae1274eb81426a9e776) Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS.d/next/Library/2019-12-15-18-47-20.bpo-39040.tKa0Qs.rst2
1 files changed, 2 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2019-12-15-18-47-20.bpo-39040.tKa0Qs.rst b/Misc/NEWS.d/next/Library/2019-12-15-18-47-20.bpo-39040.tKa0Qs.rst
new file mode 100644
index 00000000000..078bce22be3
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2019-12-15-18-47-20.bpo-39040.tKa0Qs.rst
@@ -0,0 +1,2 @@
+Fix parsing of invalid mime headers parameters by collapsing whitespace between
+encoded words in a bare-quote-string.