Permalink
Browse files

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.
  • Loading branch information...
1 parent 92367a8 commit 4a4e7f1801fee9a6782b7420bc6fe525311db77b @lelutin lelutin committed with apenwarr Jul 12, 2010
Showing with 2 additions and 1 deletion.
  1. +1 −1 Documentation/bup-web.1.md
  2. +1 −0 cmd/web-cmd.py
@@ -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).
View
@@ -54,6 +54,7 @@ def _list_directory(self, path, n):
# 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

0 comments on commit 4a4e7f1

Please sign in to comment.