1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[svn] Use the full path when building the authorization line.

Published in <sxsitbqu9iw.fsf@florida.arsdigita.de>.
This commit is contained in:
hniksic 2001-12-01 09:39:07 -08:00
parent 3ff0a9ad00
commit 569fd61c95
3 changed files with 21 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2001-12-01 Hrvoje Niksic <hniksic@arsdigita.com>
* url.c (url_full_path): Document better.
* http.c (gethttp): Use the full path when creating digest
authorization.
2001-12-01 Hrvoje Niksic <hniksic@arsdigita.com> 2001-12-01 Hrvoje Niksic <hniksic@arsdigita.com>
* cookies.c (path_matches): Return 0 if PREFIX doesn't begin with * cookies.c (path_matches): Return 0 if PREFIX doesn't begin with

View File

@ -756,8 +756,13 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
} }
else else
{ {
/* Use the full path, i.e. one that includes the leading
slash and the query string, but is independent of proxy
setting. */
char *pth = url_full_path (u);
wwwauth = create_authorization_line (authenticate_h, user, passwd, wwwauth = create_authorization_line (authenticate_h, user, passwd,
command, u->path); command, pth);
xfree (pth);
} }
} }
@ -812,6 +817,9 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
if (proxy) if (proxy)
full_path = xstrdup (u->url); full_path = xstrdup (u->url);
else else
/* Use the full path, i.e. one that includes the leading slash and
the query string. E.g. if u->path is "foo/bar" and u->query is
"param=value", full_path will be "/foo/bar?param=value". */
full_path = url_full_path (u); full_path = url_full_path (u);
/* Allocate the memory for the request. */ /* Allocate the memory for the request. */

View File

@ -886,7 +886,10 @@ full_path_write (const struct url *url, char *where)
#undef FROB #undef FROB
} }
/* Public function for getting the "full path". */ /* Public function for getting the "full path". E.g. if u->path is
"foo/bar" and u->query is "param=value", full_path will be
"/foo/bar?param=value". */
char * char *
url_full_path (const struct url *url) url_full_path (const struct url *url)
{ {
@ -900,6 +903,7 @@ url_full_path (const struct url *url)
} }
/* Sync u->path and u->url with u->dir and u->file. */ /* Sync u->path and u->url with u->dir and u->file. */
static void static void
sync_path (struct url *url) sync_path (struct url *url)
{ {