From: Ben Darnell Date: Sat, 2 Feb 2019 17:41:03 +0000 (-0500) Subject: httputil: Downgrade a noisy log line X-Git-Tag: v6.0.0b1~3^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48efd1cbdd72001cdd47c77497f59a02cc5e6dbe;p=thirdparty%2Ftornado.git httputil: Downgrade a noisy log line Only complain about unsupported content encodings if it's a content-type we'd otherwise try to parse. Fixes #2578 --- diff --git a/tornado/httputil.py b/tornado/httputil.py index ec94b1b9d..835327d0a 100644 --- a/tornado/httputil.py +++ b/tornado/httputil.py @@ -777,10 +777,12 @@ def parse_body_arguments( and ``files`` parameters are dictionaries that will be updated with the parsed contents. """ - if headers and "Content-Encoding" in headers: - gen_log.warning("Unsupported Content-Encoding: %s", headers["Content-Encoding"]) - return if content_type.startswith("application/x-www-form-urlencoded"): + if headers and "Content-Encoding" in headers: + gen_log.warning( + "Unsupported Content-Encoding: %s", headers["Content-Encoding"] + ) + return try: uri_arguments = parse_qs_bytes(native_str(body), keep_blank_values=True) except Exception as e: @@ -790,6 +792,11 @@ def parse_body_arguments( if values: arguments.setdefault(name, []).extend(values) elif content_type.startswith("multipart/form-data"): + if headers and "Content-Encoding" in headers: + gen_log.warning( + "Unsupported Content-Encoding: %s", headers["Content-Encoding"] + ) + return try: fields = content_type.split(";") for field in fields: