From: gcalvino Date: Tue, 30 Oct 2018 10:46:09 +0000 (+0100) Subject: Remove "Content-File-MD5" header for yaml or json upload X-Git-Tag: v5.0.0~25 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F93%2F6793%2F1;p=osm%2FNBI.git Remove "Content-File-MD5" header for yaml or json upload Signed-off-by: gcalvino --- diff --git a/osm_nbi/nbi.py b/osm_nbi/nbi.py index 4a5b0cc..0414dba 100644 --- a/osm_nbi/nbi.py +++ b/osm_nbi/nbi.py @@ -259,9 +259,11 @@ class Server(object): if "application/json" in cherrypy.request.headers["Content-Type"]: error_text = "Invalid json format " indata = json.load(self.reader(cherrypy.request.body)) + cherrypy.request.headers.pop("Content-File-MD5", None) elif "application/yaml" in cherrypy.request.headers["Content-Type"]: error_text = "Invalid yaml format " indata = yaml.load(cherrypy.request.body) + cherrypy.request.headers.pop("Content-File-MD5", None) elif "application/binary" in cherrypy.request.headers["Content-Type"] or \ "application/gzip" in cherrypy.request.headers["Content-Type"] or \ "application/zip" in cherrypy.request.headers["Content-Type"] or \ @@ -281,9 +283,11 @@ class Server(object): # 'application/yaml' for input format are available") error_text = "Invalid yaml format " indata = yaml.load(cherrypy.request.body) + cherrypy.request.headers.pop("Content-File-MD5", None) else: error_text = "Invalid yaml format " indata = yaml.load(cherrypy.request.body) + cherrypy.request.headers.pop("Content-File-MD5", None) if not indata: indata = {}