diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c index f0b73fa1e0b..0b6be1a1b02 100644 --- a/modules/proxy/mod_proxy.c +++ b/modules/proxy/mod_proxy.c @@ -1968,9 +1968,9 @@ PROXY_DECLARE(const char *) ap_proxy_de_socketfy(apr_pool_t *p, const char *url) const char *ret, *c; ret = ptr + 1; - /* special case: "unix:....|scheme:" is OK, expand - * to "unix:....|scheme://localhost" - * */ + /* special cases: "unix:...|scheme:" ind "unix:...|scheme://" are OK, + * expand to "unix:....|scheme://localhost" + */ c = ap_strchr_c(ret, ':'); if (c == NULL) { return NULL; @@ -1978,6 +1978,9 @@ PROXY_DECLARE(const char *) ap_proxy_de_socketfy(apr_pool_t *p, const char *url) if (c[1] == '\0') { return apr_pstrcat(p, ret, "//localhost", NULL); } + else if (c[1] == '/' && c[2] == '/' && !c[3]) { + return apr_pstrcat(p, ret, "localhost", NULL); + } else { return ret; } diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index ae964eb930f..558af5cfab3 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -1978,7 +1978,7 @@ PROXY_DECLARE(char *) ap_proxy_define_worker_ex(apr_pool_t *p, && (ptr = ap_strchr_c(url + 5, '|'))) { rv = apr_uri_parse(p, apr_pstrmemdup(p, url, ptr - url), &uri); if (rv == APR_SUCCESS) { - sockpath = ap_runtime_dir_relative(p, uri.path);; + sockpath = ap_runtime_dir_relative(p, uri.path); ptr++; /* so we get the scheme for the uds */ } else { @@ -2044,7 +2044,7 @@ PROXY_DECLARE(char *) ap_proxy_define_worker_ex(apr_pool_t *p, if (!uri.scheme) { return apr_pstrcat(p, "URL must be absolute!: ", url, NULL); } - if (!uri.hostname) { + if (!uri.hostname || !*uri.hostname) { if (sockpath) { /* allow for unix:/path|http: */ uri.hostname = "localhost";