HN44 / pywebdav

Automatically exported from code.google.com/p/pywebdav
0 stars 0 forks source link

Headers must be initialized before call to log_error. #34

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Start DAV server.

2. Attempt to mount it using https:

gvfs-mount davs://localhost:8008/

What is the expected output? What do you see instead?

This should fail, however, the client should get a graceful failure, since 
HTTPS is not supported.

Instead, client sees:

Error mounting location: HTTP Error: Connection terminated unexpectedly

And the server console prints:

Exception happened during processing of request from ('127.0.0.1', 41515)
Traceback (most recent call last):
  File "/usr/lib/python2.6/SocketServer.py", line 558, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python2.6/SocketServer.py", line 320, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.6/SocketServer.py", line 615, in __init__
    self.handle()
  File "/usr/local/lib/python2.6/dist-packages/PyWebDAV-0.9.4-py2.6.egg/DAV/AuthServer.py", line 229, in handle
    AuthRequestHandler.handle(self)
  File "/usr/local/lib/python2.6/dist-packages/PyWebDAV-0.9.4-py2.6.egg/DAV/AuthServer.py", line 121, in handle
    self.send_error(400, "Bad request syntax (%s)" % `requestline`)
  File "/usr/lib/python2.6/BaseHTTPServer.py", line 353, in send_error
    self.log_error("code %d, message %s", code, message)
  File "/usr/lib/python2.6/BaseHTTPServer.py", line 425, in log_error
    self.log_message(format, *args)
  File "/usr/local/lib/python2.6/dist-packages/PyWebDAV-0.9.4-py2.6.egg/DAV/WebDAVServer.py", line 720, in log_message
    *tuple(('- %s - ' + args[0],) + (self.headers.get('User-Agent', '?'),) + args[1:])
AttributeError: DAVRequestHandler instance has no attribute 'headers'

What version of the product are you using? On what operating system?

0.9.4 on Ubuntu.

Please provide any additional information below.

Patch to fix this issue is provided.

Original issue reported on code.google.com by btimby@gmail.com on 15 Jun 2010 at 2:27

Attachments:

GoogleCodeExporter commented 8 years ago
Fix with r65
Thanks

Original comment by cedric.krier@b2ck.com on 1 Oct 2010 at 7:03