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

[svn] Fix request-line argument when talking to SSL server over proxy.

This commit is contained in:
hniksic 2005-05-06 16:27:47 -07:00
parent 110e13d093
commit 4c4c440401
2 changed files with 22 additions and 2 deletions

View File

@ -1,3 +1,12 @@
2005-05-07 Hrvoje Niksic <hniksic@xemacs.org>
* http.c (gethttp): When tunnelling SSL traffic over proxy with
CONNECT, we're really talking to the remote server directly.
Because of this, the request-line argument must be the URL path
rather than the whole URL, as it would be when using regular
proxies.
Reported by Charles Lane.
2005-05-06 Hrvoje Niksic <hniksic@xemacs.org>
* init.c (cmd_spec_useragent): Allow empty User-Agent.

View File

@ -1216,6 +1216,7 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
req = request_new ();
{
char *meth_arg;
const char *meth = "GET";
if (*dt & HEAD_ONLY)
meth = "HEAD";
@ -1224,8 +1225,18 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
/* 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". */
request_set_method (req, meth,
proxy ? xstrdup (u->url) : url_full_path (u));
if (proxy
#ifdef HAVE_SSL
/* When using SSL over proxy, CONNECT establishes a direct
connection to the HTTPS server. Therefore use the same
argument as when talking to the server directly. */
&& u->scheme != SCHEME_HTTPS
#endif
)
meth_arg = xstrdup (u->url);
else
meth_arg = url_full_path (u);
request_set_method (req, meth, meth_arg);
}
request_set_header (req, "Referer", (char *) hs->referer, rel_none);