Skip to content

Commit

Permalink
utils: send auth to any host redirected to (#633)
Browse files Browse the repository at this point in the history
Curl will not send the auth credentials to a host that it has been
redirected to by default. Set `pycurl.UNRESTRICTED_AUTH` which is the
option for `--location-trusted` to allow sending the name + password to
all hosts that the site may redirect to.

Fixes: #632
  • Loading branch information
jkoelker committed Apr 4, 2019
1 parent 5a36f7e commit 830a66c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ def __init__(self, url, auth, verify):
# when they're coming from a non-leader. So we follow redirects.
self.curl.setopt(pycurl.FOLLOWLOCATION, True)
self.curl.setopt(pycurl.MAXREDIRS, 1)
self.curl.setopt(pycurl.UNRESTRICTED_AUTH, True)

# The below settings are to prevent the connection from hanging if the
# connection breaks silently. Since marathon-lb only listens, silent
Expand Down

0 comments on commit 830a66c

Please sign in to comment.