]> arthur.barton.de Git - bup.git/commitdiff
Fix HEAD request handling in bup-web
authorWill Rouesnel <w.rouesnel@gmail.com>
Thu, 12 Jun 2014 17:58:49 +0000 (03:58 +1000)
committerRob Browning <rlb@defaultvalue.org>
Thu, 17 Jul 2014 16:18:50 +0000 (11:18 -0500)
HEAD requests to files did not set self.finished(). This causes problems
with user-agents that expect some type of request since it never closes
(OpenOffice/LibreOffice will notably stall opening files from a URL).

This patch stands alone from WebDAV but also fixes the problem there.

The problem can be demonstrated like this:

    bup web
    curl -I 'http://127.0.0.1:8080/some/file'

Signed-off-by: Will Rouesnel <w.rouesnel@gmail.com>
[rlb@defaultvalue.org: adjust commit message]
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
cmd/web-cmd.py

index c94b7c647cb4e544069d08bf42555215c0f6862b..fc4d117d4c6ef582a3a5cf72fa131e731794139d 100755 (executable)
@@ -143,6 +143,8 @@ class BupRequestHandler(tornado.web.RequestHandler):
                 self.request.connection.stream.write(blob,
                                                      callback=lambda: me(me))
             write_more(write_more)
+        else:
+            self.finish()
 
     def _guess_type(self, path):
         """Guess the type of a file.