Get empty string if Content-Type is not in headers

This commit is contained in:
Jakub Kadlčík
2017-02-27 16:20:01 +01:00
parent cef690f260
commit 9429114836

View File

@@ -98,7 +98,7 @@ class ModuleBuildAPI(MethodView):
username, conf.allowed_groups, groups))
kwargs = {"username": username}
module = (self.post_file(**kwargs) if "multipart/form-data" in request.headers.get("Content-Type") else
module = (self.post_file(**kwargs) if "multipart/form-data" in request.headers.get("Content-Type", "") else
self.post_scm(**kwargs))
return jsonify(module.json()), 201