mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
Send new cookies when the authorization fails.
This commit is contained in:
parent
a59e12ab26
commit
8ff8a1d289
@ -1,3 +1,8 @@
|
|||||||
|
2010-05-27 Giuseppe Scrivano <gscrivano@gnu.org>
|
||||||
|
|
||||||
|
* http.c (gethttp): Consider new cookies retrieved when the
|
||||||
|
authorization fails.
|
||||||
|
|
||||||
2010-05-25 Giuseppe Scrivano <gscrivano@gnu.org>
|
2010-05-25 Giuseppe Scrivano <gscrivano@gnu.org>
|
||||||
|
|
||||||
* host.c (sufmatch): Do not consider zero length entries.
|
* host.c (sufmatch): Do not consider zero length entries.
|
||||||
|
34
src/http.c
34
src/http.c
@ -1694,18 +1694,6 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy,
|
|||||||
if (!inhibit_keep_alive)
|
if (!inhibit_keep_alive)
|
||||||
request_set_header (req, "Connection", "Keep-Alive", rel_none);
|
request_set_header (req, "Connection", "Keep-Alive", rel_none);
|
||||||
|
|
||||||
if (opt.cookies)
|
|
||||||
request_set_header (req, "Cookie",
|
|
||||||
cookie_header (wget_cookie_jar,
|
|
||||||
u->host, u->port, u->path,
|
|
||||||
#ifdef HAVE_SSL
|
|
||||||
u->scheme == SCHEME_HTTPS
|
|
||||||
#else
|
|
||||||
0
|
|
||||||
#endif
|
|
||||||
),
|
|
||||||
rel_value);
|
|
||||||
|
|
||||||
if (opt.post_data || opt.post_file_name)
|
if (opt.post_data || opt.post_file_name)
|
||||||
{
|
{
|
||||||
request_set_header (req, "Content-Type",
|
request_set_header (req, "Content-Type",
|
||||||
@ -1727,6 +1715,23 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy,
|
|||||||
rel_value);
|
rel_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
retry_with_auth:
|
||||||
|
/* We need to come back here when the initial attempt to retrieve
|
||||||
|
without authorization header fails. (Expected to happen at least
|
||||||
|
for the Digest authorization scheme.) */
|
||||||
|
|
||||||
|
if (opt.cookies)
|
||||||
|
request_set_header (req, "Cookie",
|
||||||
|
cookie_header (wget_cookie_jar,
|
||||||
|
u->host, u->port, u->path,
|
||||||
|
#ifdef HAVE_SSL
|
||||||
|
u->scheme == SCHEME_HTTPS
|
||||||
|
#else
|
||||||
|
0
|
||||||
|
#endif
|
||||||
|
),
|
||||||
|
rel_value);
|
||||||
|
|
||||||
/* Add the user headers. */
|
/* Add the user headers. */
|
||||||
if (opt.user_headers)
|
if (opt.user_headers)
|
||||||
{
|
{
|
||||||
@ -1735,11 +1740,6 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy,
|
|||||||
request_set_user_header (req, opt.user_headers[i]);
|
request_set_user_header (req, opt.user_headers[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
retry_with_auth:
|
|
||||||
/* We need to come back here when the initial attempt to retrieve
|
|
||||||
without authorization header fails. (Expected to happen at least
|
|
||||||
for the Digest authorization scheme.) */
|
|
||||||
|
|
||||||
proxyauth = NULL;
|
proxyauth = NULL;
|
||||||
if (proxy)
|
if (proxy)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user