mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
Fix IPv6 literal addresses passed to a proxied backend.
PR 47177 Patch by Carlos Garcia Braschi git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@778531 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -713,11 +713,20 @@ int ap_proxy_http_request(apr_pool_t *p, request_rec *r,
|
||||
e = apr_bucket_pool_create(buf, strlen(buf), p, c->bucket_alloc);
|
||||
APR_BRIGADE_INSERT_TAIL(header_brigade, e);
|
||||
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);
|
||||
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 {
|
||||
buf = apr_pstrcat(p, "Host: ", uri->hostname, CRLF, NULL);
|
||||
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 {
|
||||
|
Reference in New Issue
Block a user