1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-10 13:04:23 +01:00

* http.c (send_request): Add a Host: header for virtual hosts.

This commit is contained in:
David Shaw 2003-12-06 18:35:32 +00:00
parent d1b08dafe3
commit acdcbd6550
2 changed files with 7 additions and 5 deletions

View File

@ -1,3 +1,7 @@
2003-12-06 David Shaw <dshaw@jabberwocky.com>
* http.c (send_request): Add a Host: header for virtual hosts.
2003-12-04 David Shaw <dshaw@jabberwocky.com> 2003-12-04 David Shaw <dshaw@jabberwocky.com>
* miscutil.c (answer_is_yes_no_default, answer_is_yes_no_quit): * miscutil.c (answer_is_yes_no_default, answer_is_yes_no_quit):

View File

@ -504,7 +504,7 @@ send_request( HTTP_HD hd )
return G10ERR_NETWORK; return G10ERR_NETWORK;
p = build_rel_path( hd->uri ); p = build_rel_path( hd->uri );
request = m_alloc( strlen(server) + strlen(p) + 50 ); request = m_alloc( strlen(server)*2 + strlen(p) + 50 );
if( http_proxy ) { if( http_proxy ) {
sprintf( request, "%s http://%s:%hu%s%s HTTP/1.0\r\n", sprintf( request, "%s http://%s:%hu%s%s HTTP/1.0\r\n",
hd->req_type == HTTP_REQ_GET ? "GET" : hd->req_type == HTTP_REQ_GET ? "GET" :
@ -513,11 +513,11 @@ send_request( HTTP_HD hd )
server, port, *p == '/'? "":"/", p ); server, port, *p == '/'? "":"/", p );
} }
else { else {
sprintf( request, "%s %s%s HTTP/1.0\r\n", sprintf( request, "%s %s%s HTTP/1.0\r\nHost: %s\r\n",
hd->req_type == HTTP_REQ_GET ? "GET" : hd->req_type == HTTP_REQ_GET ? "GET" :
hd->req_type == HTTP_REQ_HEAD? "HEAD": hd->req_type == HTTP_REQ_HEAD? "HEAD":
hd->req_type == HTTP_REQ_POST? "POST": "OOPS", hd->req_type == HTTP_REQ_POST? "POST": "OOPS",
*p == '/'? "":"/", p ); *p == '/'? "":"/", p, server);
} }
m_free(p); m_free(p);
@ -528,8 +528,6 @@ send_request( HTTP_HD hd )
} }
/**************** /****************
* Build the relative path from the parsed URI. * Build the relative path from the parsed URI.
* Minimal implementation. * Minimal implementation.