[PATCH 3 of 4] Fix two small bugs that would've prevented the web interface and IPv6
Alexis S. L. Carvalho
alexis at cecm.usp.br
Tue Jun 27 12:56:00 UTC 2006
Thus spake Eric Hopper:
> # HG changeset patch
> # User Eric Hopper <hopper at omnifarious.org>
> # Node ID 4c41db2ba43b72401a1de57f2499753dababc5bf
> # Parent cebc99ef27f5918727d821cec2899c8f215481a3
> Fix two small bugs that would've prevented the web interface and IPv6
> from working.
>
> diff -r cebc99ef27f5 -r 4c41db2ba43b mercurial/hgweb/request.py
> --- a/mercurial/hgweb/request.py Fri Jun 23 13:03:34 2006 -0700
> +++ b/mercurial/hgweb/request.py Mon Jun 26 09:21:04 2006 -0700
> @@ -59,7 +59,7 @@ class _wsgirequest(object):
> def write(self, *things):
> if self.server_write is None:
> if not self.headers:
> - raise RuntimeError("request.write called before headers sent.")
> + self.header()
> self.server_write = self.start_response('200 Script output follows',
> self.headers)
> self.start_response = None
This change is not enough - self.header() will send a default
"Content-type: text/html" header, ignoring the headers that are embedded
in the template files.
In practice this means that you have a "Content-type: text/html" (from
the template file, not the default sent by header()) at the top of every
regular page (and something a bit worse if you ask for the raw version
of a file).
(BTW, it should be possible to fix issue 254 while fixing this)
Alexis
More information about the Mercurial
mailing list