From: Gabriel Filion Date: Mon, 12 Jul 2010 06:23:24 +0000 (-0400) Subject: cmd/web: tiny fix to make redirects work with Firefox. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=4a4e7f1801fee9a6782b7420bc6fe525311db77b;p=packages%2Fb%2Fbup.git cmd/web: tiny fix to make redirects work with Firefox. Firefox honours Content-Length even for 301 redirects, so if the field isn't provided, it assumes there's an unlimited amount of data and just hangs. Also fixed a typo in the man page. --- diff --git a/Documentation/bup-web.1.md b/Documentation/bup-web.1.md index a334945..23e82a8 100644 --- a/Documentation/bup-web.1.md +++ b/Documentation/bup-web.1.md @@ -12,7 +12,7 @@ bup web [[hostname]:port] # DESCRIPTION -`bup web` is a starts a web server that can browse bup repositories. The file +`bup web` starts a web server that can browse bup repositories. The file hierarchy is the same as that shown by `bup-fuse`(1), `bup-ls`(1) and `bup-ftp`(1). diff --git a/cmd/web-cmd.py b/cmd/web-cmd.py index 209e57d..b412044 100755 --- a/cmd/web-cmd.py +++ b/cmd/web-cmd.py @@ -54,6 +54,7 @@ class BupRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): # redirect browser - doing basically what apache does self.send_response(301) self.send_header("Location", path + "/") + self.send_header("Content-Length", 0) self.end_headers() return