version 1.190, 2020/02/19 07:29:53 |
version 1.191, 2020/02/19 12:39:38 |
|
|
errx(1, "%s: URL not permitted", newline); |
errx(1, "%s: URL not permitted", newline); |
|
|
path = strchr(host, '/'); /* Find path */ |
path = strchr(host, '/'); /* Find path */ |
|
|
|
#ifndef NOSSL |
|
/* |
|
* Look for auth header in host. |
|
* Basic auth from RFC 2617, valid characters for path are in |
|
* RFC 3986 section 3.3. |
|
*/ |
|
if (ishttpurl || ishttpsurl) { |
|
p = strchr(host, '@'); |
|
if (p != NULL && (path == NULL || p < path)) { |
|
*p++ = '\0'; |
|
credentials = recode_credentials(host); |
|
|
|
/* Overwrite userinfo */ |
|
memmove(host, p, strlen(p) + 1); |
|
path = strchr(host, '/'); |
|
} |
|
} |
|
#endif /* !NOSSL */ |
|
|
if (EMPTYSTRING(path)) { |
if (EMPTYSTRING(path)) { |
if (outfile) { /* No slash, but */ |
if (outfile) { /* No slash, but */ |
path = strchr(host,'\0'); /* we have outfile. */ |
path = strchr(host,'\0'); /* we have outfile. */ |
|
|
} |
} |
|
|
noslash: |
noslash: |
|
|
#ifndef NOSSL |
|
/* |
|
* Look for auth header in host, since now host does not |
|
* contain the path. Basic auth from RFC 2617, valid |
|
* characters for path are in RFC 3986 section 3.3. |
|
*/ |
|
if (ishttpurl || ishttpsurl) { |
|
if ((p = strchr(host, '@')) != NULL) { |
|
*p = '\0'; |
|
credentials = recode_credentials(host); |
|
host = p + 1; |
|
} |
|
} |
|
#endif /* NOSSL */ |
|
|
|
if (outfile) |
if (outfile) |
savefile = outfile; |
savefile = outfile; |
else { |
else { |