X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/0ee337113e722c9fd6ef46dda5819a607ec1a9b6..a46779a65b431b0060abbcec3600af18111e6371:/doc/bugs/Running_on_an_alternative_port_fails.mdwn diff --git a/doc/bugs/Running_on_an_alternative_port_fails.mdwn b/doc/bugs/Running_on_an_alternative_port_fails.mdwn index 864c99fed..942700ba3 100644 --- a/doc/bugs/Running_on_an_alternative_port_fails.mdwn +++ b/doc/bugs/Running_on_an_alternative_port_fails.mdwn @@ -55,3 +55,39 @@ right. number from the `Host:` header. That can be fixed. >>>>> Thanks for the assist. -- fergus + +--- + +Patch for `thttpd-2.25b` for posterity and completeness + +[[!format patch """ + +diff --git a/libhttpd.c b/libhttpd.c +index 73689be..039b7e3 100644 +--- a/libhttpd.c ++++ b/libhttpd.c +@@ -2074,9 +2074,6 @@ httpd_parse_request( httpd_conn* hc ) + cp = &buf[5]; + cp += strspn( cp, " \t" ); + hc->hdrhost = cp; +- cp = strchr( hc->hdrhost, ':' ); +- if ( cp != (char*) 0 ) +- *cp = '\0'; + if ( strchr( hc->hdrhost, '/' ) != (char*) 0 || hc->hdrhost[0] == '.' ) + { + httpd_send_err( hc, 400, httpd_err400title, "", httpd_err400form, "" ); + +"""]] + +-- fergus + +--- + +I've gone ahead and filed a bug on CGI.pm too: + --[[Joey]] + +--- + +That'll be an interesting discussion as I'd suggest that HTTP_ headers are defined in the CGI specification as client headers and thus what `thttpd` is doing is wrong (i.e. mangling the client's own representation). Whether a CGI client should trust HTTP_ header over the server is probably already settled by convention. + +-- fergus