https://issues.apache.org/bugzilla/show_bug.cgi?id=47177
--- Comment #3 from Carlos Garcia Braschi <[email protected]> 2009-05-11 00:17:43 PST --- mod_proxy_http.c A naive and untested fix (I'm sorry, but I don't have a developer environment to test it), borrowing from the proxy_http_canon function, would be to change function ap_proxy_http_request in this way. from: if (conf->preserve_host == 0) { if (uri->port_str && uri->port != DEFAULT_HTTP_PORT) { buf = apr_pstrcat(p, "Host: ", uri->hostname, ":", uri->port_str, CRLF, NULL); } else { buf = apr_pstrcat(p, "Host: ", uri->hostname, CRLF, NULL); } } to if (conf->preserve_host == 0) { if (ap_strchr_c(uri->hostname, ':')) { /* if literal IPv6 address */ if (uri->port_str && uri->port != DEFAULT_HTTP_PORT) { buf = apr_pstrcat(p, "Host: [", uri->hostname, "]:", uri->port_str, CRLF, NULL); } else { buf = apr_pstrcat(p, "Host: [", uri->hostname, "]", CRLF, NULL); } } else { if (uri->port_str && uri->port != DEFAULT_HTTP_PORT) { buf = apr_pstrcat(p, "Host: ", uri->hostname, ":", uri->port_str, CRLF, NULL); } else { buf = apr_pstrcat(p, "Host: ", uri->hostname, CRLF, NULL); } } } I'm not sure if a more architectural fix having apr_uri_parse function leaving the brackets for IPv6 hostnames would be better, as they are always required to be there in URIs... but that means apr_uri and all of the code depending on apr_uri to be fixed.... -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
