mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Don't reuse credentials if redirected to a different host.
Submitted by: Niels Heinen <heinenn@google.com> MFC after: 3 weeks
This commit is contained in:
parent
30787285b5
commit
f51b84bcc4
1 changed files with 3 additions and 1 deletions
|
|
@ -1779,7 +1779,9 @@ http_request(struct url *URL, const char *op, struct url_stat *us,
|
|||
DEBUG(fprintf(stderr, "failed to parse new URL\n"));
|
||||
goto ouch;
|
||||
}
|
||||
if (!*new->user && !*new->pwd) {
|
||||
|
||||
/* Only copy credentials if the host matches */
|
||||
if (!strcmp(new->host, url->host) && !*new->user && !*new->pwd) {
|
||||
strcpy(new->user, url->user);
|
||||
strcpy(new->pwd, url->pwd);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue