Skip to content

Commit

Permalink
Fix: webhook pw with colon (#99)
Browse files Browse the repository at this point in the history
* allow colon in webhook pw also in ephemeral_processing
  • Loading branch information
anikaweinmann authored Aug 4, 2020
1 parent 22e9716 commit 6f00593
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/actinia_core/resources/ephemeral_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,8 @@ def _send_to_database(self, document, final=False):
self.message_logger.info("Send POST request to finished webhook url: %s"%self.webhook_finished)
http_code, response_model = pickle.loads(document)
if self.webhook_auth:
r = requests.post(self.webhook_finished, json=json.dumps(response_model), auth=HTTPBasicAuth(self.webhook_auth.split(':')[0], self.webhook_auth.split(':')[1]))
# username is expected to be without colon (':')
r = requests.post(self.webhook_finished, json=json.dumps(response_model), auth=HTTPBasicAuth(self.webhook_auth.split(':')[0], ':'.join(self.webhook_auth.split(':')[1:])))
else:
r = requests.post(self.webhook_finished, json=json.dumps(response_model))
if r.status_code != 200:
Expand All @@ -452,7 +453,8 @@ def _send_to_database(self, document, final=False):
self.message_logger.info("Send POST request to update webhook url: %s"%self.webhook_update)
http_code, response_model = pickle.loads(document)
if self.webhook_auth:
r = requests.post(self.webhook_update, json=json.dumps(response_model), auth=HTTPBasicAuth(self.webhook_auth.split(':')[0], self.webhook_auth.split(':')[1]))
# username is expected to be without colon (':')
r = requests.post(self.webhook_update, json=json.dumps(response_model), auth=HTTPBasicAuth(self.webhook_auth.split(':')[0], ':'.join(self.webhook_auth.split(':')[1:])))
else:
r = requests.post(self.webhook_update, json=json.dumps(response_model))
if r.status_code != 200:
Expand Down

0 comments on commit 6f00593

Please sign in to comment.