From de4adfeade8cfe69c2ee6701f80a5421bd003236 Mon Sep 17 00:00:00 2001 From: gcalvino Date: Tue, 30 Oct 2018 11:46:09 +0100 Subject: [PATCH] Remove "Content-File-MD5" header for yaml or json upload Signed-off-by: gcalvino --- osm_nbi/nbi.py | 4 ++++ 1 file changed, 4 insertions(+) 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 = {} -- 2.25.1