Where/How Hostname for HgWeb Feed URLs

Matt Mackall mpm at selenic.com
Tue Apr 1 19:27:05 UTC 2014


On Tue, 2014-04-01 at 18:56 +0000, Jensen, Aaron wrote:
> The links to specific revisions in our HgWeb's atom/rss feedss look like this:
> 
> 	https:///sandbox/rev/79ea8ea851a4
> 
> As you can see, the hostname is missing. When I crack open the changelogentry.tmpl template, I see the URL is constructed like this:
> 
> 	{urlbase}{url|urlescape}rev/{node|short}

Lemme guess: weird problem -> still using IIS. Ya know.. getting a copy
of Apache and Linux costs less than sending me lots of email.

The urlbase value is automatically constructed internally from the
SERVER_NAME environment variable. The relevant code is here:

http://www.selenic.com/hg/file/e259d4c462b5/mercurial/hgweb/hgweb_mod.py#l327

You can probably manually set it in your hgweb stub script.

According to PEP 0333 (aka the WSGI spec), the SERVER_NAME variable is a
required part of the request environment.. so your WSGI wrapper is
buggy. But we should also probably prefer HTTP_HOST in the header if
it's available.. but it's all a little complicated.

I've created a bug to track this:

http://bz.selenic.com/show_bug.cgi?id=4213

-- 
Mathematics is the supreme nostalgia of our time.





More information about the Mercurial mailing list