From f1f5f30462c5d317d3dbd0b01e9f567964c4e986 Mon Sep 17 00:00:00 2001 From: ianb Date: Wed, 30 Jul 2008 17:44:01 +0000 Subject: In proxy, set content-length and filter more bad headers --- paste/proxy.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'paste/proxy.py') diff --git a/paste/proxy.py b/paste/proxy.py index 8972f58..e9a8749 100644 --- a/paste/proxy.py +++ b/paste/proxy.py @@ -39,7 +39,14 @@ from paste.util.converters import aslist # Remove these headers from response (specify lower case header # names): filtered_headers = ( - 'transfer-encoding', + 'transfer-encoding', + 'connection', + 'keep-alive', + 'proxy-authenticate', + 'proxy-authorization', + 'te', + 'trailers', + 'upgrade', ) class Proxy(object): @@ -83,6 +90,7 @@ class Proxy(object): if environ.get('CONTENT_TYPE'): headers['content-type'] = environ['CONTENT_TYPE'] if environ.get('CONTENT_LENGTH'): + headers['content-length'] = environ['CONTENT_LENGTH'] length = int(environ['CONTENT_LENGTH']) body = environ['wsgi.input'].read(length) else: -- cgit v1.2.1