Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix curl basic auth

  • Loading branch information...
commit bcb30e56fd3939482daa59b166d21835d77d4f23 1 parent 1b38b58
@mankyd mankyd authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 tornado/curl_httpclient.py
View
6 tornado/curl_httpclient.py
@@ -383,10 +383,10 @@ def ioctl(cmd):
else:
curl.setopt(pycurl.INFILESIZE, len(request.body))
- if request.auth_username and request.auth_password:
- userpwd = "%s:%s" % (request.auth_username, request.auth_password)
+ if request.auth_username is not None:
+ userpwd = "%s:%s" % (request.auth_username, request.auth_password or '')
curl.setopt(pycurl.HTTPAUTH, pycurl.HTTPAUTH_BASIC)
- curl.setopt(pycurl.USERPWD, userpwd)
+ curl.setopt(pycurl.USERPWD, userpwd.encode('ascii'))
logging.debug("%s %s (username: %r)", request.method, request.url,
request.auth_username)
else:
Please sign in to comment.
Something went wrong with that request. Please try again.