From c346161eedd9061ac82a00eb3ffeb32f4aeee589 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Mon, 26 Aug 2013 18:15:24 -0400 Subject: [PATCH] Fix environ var parsing. --- copyvios/misc.py | 2 +- pages/debug.mako | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/copyvios/misc.py b/copyvios/misc.py index f554f7a..ecfd674 100644 --- a/copyvios/misc.py +++ b/copyvios/misc.py @@ -15,7 +15,7 @@ class Query(object): if method == "GET": parsed = parse_qs(environ["QUERY_STRING"]) elif method == "POST": - size = environ.get("CONTENT_LENGTH", 0) + size = int(environ.get("CONTENT_LENGTH", 0)) parsed = parse_qs(environ["wsgi.input"].read(size)) else: parsed = {} diff --git a/pages/debug.mako b/pages/debug.mako index 25dafca..3bc7ae5 100644 --- a/pages/debug.mako +++ b/pages/debug.mako @@ -4,7 +4,7 @@ % if key not in ["wsgi.input", "wsgi.errors", "PATH"]:
  • ${key}: ${value | h}
  • % elif key == "wsgi.input": -
  • ${key}: ${value.read(environ.get("CONTENT_LENGTH", 0)) | h}
  • +
  • ${key}: ${value.read(int(environ.get("CONTENT_LENGTH", 0))) | h}
  • % endif % endfor