Plan 9 from Bell Labs’s /usr/web/sources/patch/applied/httpd-host-port/readme

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


when parsing the vhosts from /sys/lib/rewrite the parser discards the
port such that

	http://foo/
and
	http://foo:1080/

are treated as the same vhost.

when parsing the http request, httplib takes the Host: header and
passes it (correctly) as the vhost.  a Host: with a :port will never
match a vhost.

The correct behaviour should be to treat the host's individually and
require multiple entries in /sys/lib/rewrite if two vhosts on the
different ports want to share namespaces.

this patch just removes the ":" from the tokenizer of the vhost
parser.

I've been running the patched httpd here since the day I supplied the
patch.

If you want to verify the correctness the explanation of the Host:
header is in section 14.23 of http://www.faqs.org/rfcs/rfc2616.html

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.