Skip to content

Commit

Permalink
Don't send blank auth
Browse files Browse the repository at this point in the history
  • Loading branch information
dbuxton committed Feb 21, 2014
1 parent 0bfebe6 commit 6d6db6c
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions app/cabotapp/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,12 +497,19 @@ def _run(self):
result = StatusCheckResult(check=self)
auth = (self.username, self.password)
try:
resp = requests.get(
self.endpoint,
timeout=self.timeout,
verify=self.verify_ssl_certificate,
auth=auth
)
if self.username or self.password:
resp = requests.get(
self.endpoint,
timeout=self.timeout,
verify=self.verify_ssl_certificate,
auth=auth
)
else:
resp = requests.get(
self.endpoint,
timeout=self.timeout,
verify=self.verify_ssl_certificate,
)
except requests.RequestException as e:
result.error = u'Request error occurred: %s' % (e,)
result.succeeded = False
Expand Down

0 comments on commit 6d6db6c

Please sign in to comment.