From: hipro Date: Fri, 8 Dec 2017 09:43:12 +0000 (+0800) Subject: Update structure.rst X-Git-Tag: v5.0.0~36^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cffe8c8e31a4f37496d0a193939f0aeea8814d16;p=thirdparty%2Ftornado.git Update structure.rst --- diff --git a/docs/guide/structure.rst b/docs/guide/structure.rst index b0735a17f..e9f9506c0 100644 --- a/docs/guide/structure.rst +++ b/docs/guide/structure.rst @@ -165,7 +165,7 @@ of form-encoding may override `~.RequestHandler.prepare` to parse their requests:: def prepare(self): - if self.request.headers["Content-Type"].startswith("application/json"): + if self.request.headers.get("Content-Type", "").startswith("application/json"): self.json_args = json.loads(self.request.body) else: self.json_args = None