From 52016223ab14c82f354b9828ca0b0b321d47bfea Mon Sep 17 00:00:00 2001 From: Disassembler Date: Sat, 18 Apr 2020 19:16:55 +0200 Subject: [PATCH] Hackfix Sahana's Web2Py gis/proxy https://github.com/sahana/eden_deploy/commit/5f1d8d8b2 https://github.com/web2py/web2py/issues/2262 --- lxc-apps/sahana/image.d/tmp/python38.patch | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lxc-apps/sahana/image.d/tmp/python38.patch b/lxc-apps/sahana/image.d/tmp/python38.patch index 8776eaa..1eed583 100644 --- a/lxc-apps/sahana/image.d/tmp/python38.patch +++ b/lxc-apps/sahana/image.d/tmp/python38.patch @@ -9,6 +9,25 @@ if not gluon.fileutils.check_credentials(request): raise HTTP(401, web2py_error='invalid credentials') stdout = sys.stdout +--- gluon/globals.py ++++ gluon/globals.py +@@ -241,7 +241,15 @@ + # parse POST variables on POST, PUT, BOTH only in post_vars + if body and not is_json and env.request_method in ('POST', 'PUT', 'DELETE', 'BOTH'): + query_string = env.pop('QUERY_STRING', None) +- dpost = cgi.FieldStorage(fp=body, environ=env, keep_blank_values=1) ++ content_disposition = env.get('HTTP_CONTENT_DISPOSITION') ++ if content_disposition: ++ headers = {'content-disposition': content_disposition, ++ 'content-type': env['CONTENT_TYPE'], ++ 'content-length': env['CONTENT_LENGTH'], ++ } ++ else: ++ headers = None ++ dpost = cgi.FieldStorage(fp=body, environ=env, headers=headers, keep_blank_values=1) + try: + post_vars.update(dpost) + except: --- gluon/languages.py +++ gluon/languages.py @@ -16,7 +16,6 @@