On Wed, Jan 21, 2004 at 01:04:24PM -0600, Jason Sibre wrote:
> With Medusa, HTTP_HOST reflects the requested URL, but SERVER_NAME seems to
> be whatever Medusa deduces it to be, (the machine's hostname, I guess) or
> whatever is specified as the server name in the Medusa setup/construction
> (I'm not so sure about that, as I haven't dug much, yet).
Looks like the code in medusa_http.py is broken in this respect:
environ = {'REQUEST_METHOD': request.command,
...
'SERVER_NAME': self.server.ip or socket.gethostname(),
}
This should probably be something like:
msg.get('Host') or self.server.ip or socket.gethostname() instead (untested
-- you'll have to test it and submit a patch).
The QuixoteHandler docstring reads:
Publish the specified Quixote publisher. 'server_name' will
be passed as the SERVER_NAME environment variable.
but this is a lie and should be deleted or rewritten; server_name is really
used as the name of the web server software, such as Apache/0.1.2 or
Quixote/demo.
--amk