mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-06 00:45:09 +00:00
Monotone-Parent: 1446e7383727bc0d371dfafcec06697f030f7117
Monotone-Revision: 7f4c04f0c1883efb437cd0189f442b20c0063c82 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-02-20T19:47:58 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -66,7 +66,7 @@ class HTTPUnparsedURL:
|
||||
class WebDAVClient:
|
||||
user_agent = "Mozilla/5.0"
|
||||
|
||||
def __init__(self, hostname, port, username = None, password = None,
|
||||
def __init__(self, hostname, port, username = None, password = "",
|
||||
forcessl = False):
|
||||
if int(port) == 443 or forcessl:
|
||||
import M2Crypto.httpslib
|
||||
@@ -75,13 +75,11 @@ class WebDAVClient:
|
||||
else:
|
||||
self.conn = httplib.HTTPConnection(hostname, port, True)
|
||||
|
||||
if username is not None:
|
||||
if password is None:
|
||||
password = ""
|
||||
if username is None:
|
||||
self.simpleauth_hash = None
|
||||
else:
|
||||
self.simpleauth_hash = (("%s:%s" % (username, password))
|
||||
.encode('base64')[:-1])
|
||||
else:
|
||||
self.simpleauth_hash = None
|
||||
|
||||
def prepare_headers(self, query, body):
|
||||
headers = { "User-Agent": self.user_agent }
|
||||
|
||||
Reference in New Issue
Block a user