Jason E. Sibre wrote:
> Ah!
>
>
>
>>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(),
>> }
>
>
>
> I didn't even think to look at that part.
>
> I'll check it out and send the patch, once I have it doing what I think is
> right. (Which means a bit of reading to be sure what I think is right,
> really is right!)
Right!
Andrew's suggestion looks like a winner: it gives a nice failover in
case 'Host' is not included in the request header.
Although I like it, would it violate the 'no-magic' rule? A request that
needed the failover would definitely violate HTTP/1.1 (ยง14.23, "A client
MUST include a Host header field in all HTTP/1.1 request messages");
perhaps a 400 Bad Request would be more appropriate than a failover.
That being said, I still think it's right. ;-) Pending discussion, I'll
get around to patching my quixote.server.medusa proposal, which also
suffers from this error.
-- Graham