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;
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;
}
&& (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 {
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";