From c64d6331d52dcf07108226c5dff26bd8b6c41e70 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Thu, 4 May 2017 10:36:49 +0200 Subject: pki.authority: Don't send header as POST body pki.authority was mistakenly sending headers as POST body instead of sending an empty POST body with right headers. Change-Id: I6a5089e55233cf72f4d8e79832150e7c45f0fdae Signed-off-by: Christian Heimes --- base/common/python/pki/authority.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'base/common/python') diff --git a/base/common/python/pki/authority.py b/base/common/python/pki/authority.py index 9fa459c26..0d83a4ba9 100644 --- a/base/common/python/pki/authority.py +++ b/base/common/python/pki/authority.py @@ -140,7 +140,7 @@ class AuthorityClient(object): url = self.ca_url + '/' + str(aid) headers = {'Content-type': 'application/json', 'Accept': 'application/json'} - r = self.connection.get(url, headers) + r = self.connection.get(url, headers=headers) return AuthorityData.from_json(r.json()) @pki.handle_exceptions() @@ -167,7 +167,7 @@ class AuthorityClient(object): raise ValueError( "Invalid format passed in - PEM or DER expected.") - r = self.connection.get(url, headers) + r = self.connection.get(url, headers=headers) return r.text @pki.handle_exceptions() @@ -189,7 +189,7 @@ class AuthorityClient(object): elif output_format == "PKCS7": headers['Accept'] = "application/pkcs7-mime" - r = self.connection.get(url, headers) + r = self.connection.get(url, headers=headers) return r.text @pki.handle_exceptions() @@ -238,7 +238,7 @@ class AuthorityClient(object): response = self.connection.post( self.ca_url, create_request, - headers) + headers=headers) new_ca = AuthorityData.from_json(response.json()) return new_ca @@ -257,7 +257,7 @@ class AuthorityClient(object): headers = {'Content-type': 'application/json', 'Accept': 'application/json'} - self.connection.post(url, headers) + self.connection.post(url, None, headers=headers) @pki.handle_exceptions() def disable_ca(self, aid): @@ -272,7 +272,7 @@ class AuthorityClient(object): headers = {'Content-type': 'application/json', 'Accept': 'application/json'} - self.connection.post(url, headers) + self.connection.post(url, None, headers=headers) @pki.handle_exceptions() def delete_ca(self, aid): @@ -287,7 +287,7 @@ class AuthorityClient(object): headers = {'Content-type': 'application/json', 'Accept': 'application/json'} - self.connection.delete(url, headers) + self.connection.delete(url, headers=headers) encoder.NOTYPES['AuthorityData'] = AuthorityData -- cgit