Пример #1
0
 def send_header(self, keyword, value):
     """Override default send_header method of
     DAVRequestHandler and thus DAVAuthHandler:
     Mangle requests to send custom 'WWW-Authenticate' header instead of
     the hard-coded 'PyWebDAV' value.
     """
     if keyword == 'WWW-Authenticate':
         value = value.replace("PyWebDAV", self.server_conf.short_title)
         
     DAVAuthHandler.send_header(self, keyword, value)
Пример #2
0
 def send_body(self, DATA, code=None, msg=None, desc=None,
               ctype='application/octet-stream', headers={}):
     """Override default send_body method of DAVRequestHandler and thus
     DAVAuthHandler:
     For some silly reason pywebdav sometimes calls send_body with str code
     but back-end send_response from BaseHTTPServer.py expects int. Force
     conversion if needed.
     Without this fix locking/writing of files fails with mapped network
     drives on Windows.
     """
     if isinstance(code, basestring) and code.isdigit():
         code = int(code)
     DAVAuthHandler.send_body(self, DATA, code, msg, desc, ctype, headers)