summaryrefslogtreecommitdiffstats
path: root/base/common/python
diff options
context:
space:
mode:
authorChristian Heimes <cheimes@redhat.com>2017-05-04 10:36:49 +0200
committerChristian Heimes <cheimes@redhat.com>2017-05-05 09:22:20 +0200
commitc64d6331d52dcf07108226c5dff26bd8b6c41e70 (patch)
tree9e9c5317b891144b36d1ca6216871e7691f5d53d /base/common/python
parent220e35d2b5610cb051831b990451b3b3ff53604e (diff)
downloadpki-c64d6331d52dcf07108226c5dff26bd8b6c41e70.tar.gz
pki-c64d6331d52dcf07108226c5dff26bd8b6c41e70.tar.xz
pki-c64d6331d52dcf07108226c5dff26bd8b6c41e70.zip
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 <cheimes@redhat.com>
Diffstat (limited to 'base/common/python')
-rw-r--r--base/common/python/pki/authority.py14
1 files changed, 7 insertions, 7 deletions
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