From 32cd9b22c33567dc64d67cf50e2bdf7addcd9d23 Mon Sep 17 00:00:00 2001 From: Radko Krkos <krkos@cesnet.cz> Date: Wed, 21 Nov 2018 20:06:15 +0100 Subject: [PATCH] =?UTF-8?q?Server:=20Fix=20grave=20misspelling=20of=20CONT?= =?UTF-8?q?ENT=5FLENGTH=20wsgi=20variable=20(thx=20Honza=20=C5=BDerd=C3=AD?= =?UTF-8?q?k)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Introduced in 5f2e50a0e469fa4695f3634a082dab6357d37219 * Caused the POST payload to be always ignored, breaking the function completely. * Great job finding and debugging this, Honza Žerdík. --- warden_server/warden_server.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/warden_server/warden_server.py b/warden_server/warden_server.py index 25acd57..c69fb6a 100755 --- a/warden_server/warden_server.py +++ b/warden_server/warden_server.py @@ -927,10 +927,10 @@ class Server(ObjectBase): # preserve compatibility with clients deployed in the wild, which use POST for # all requests (even those without payload, with no specified content length). # According to PEP3333, section "Input and Error Streams", the application SHOULD - # NOT attempt to read more data than specified by CONTENT-LENGTH. As stated in - # section "environ Variables", CONTENT-LENGTH may be empty (string) or absent. + # NOT attempt to read more data than specified by CONTENT_LENGTH. As stated in + # section "environ Variables", CONTENT_LENGTH may be empty (string) or absent. try: - content_length = int(environ.get('CONTENT-LENGTH', 0)) + content_length = int(environ.get('CONTENT_LENGTH', 0)) except ValueError: content_length = 0 -- GitLab