aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2003-12-06 18:35:32 +0000
committerDavid Shaw <[email protected]>2003-12-06 18:35:32 +0000
commitacdcbd655072c1c389e15f3d2900f49faa8eb54b (patch)
tree30502d583bc0bc94ca42c3c3a3071dacddaf950f
parent* Makefile.am: Reenable tests now that the Elgamal signature keys are (diff)
downloadgnupg-acdcbd655072c1c389e15f3d2900f49faa8eb54b.tar.gz
gnupg-acdcbd655072c1c389e15f3d2900f49faa8eb54b.zip
* http.c (send_request): Add a Host: header for virtual hosts.
Diffstat (limited to '')
-rw-r--r--util/ChangeLog4
-rw-r--r--util/http.c8
2 files changed, 7 insertions, 5 deletions
diff --git a/util/ChangeLog b/util/ChangeLog
index be47a0a1e..301b9e504 100644
--- a/util/ChangeLog
+++ b/util/ChangeLog
@@ -1,3 +1,7 @@
+2003-12-06 David Shaw <[email protected]>
+
+ * http.c (send_request): Add a Host: header for virtual hosts.
+
2003-12-04 David Shaw <[email protected]>
* miscutil.c (answer_is_yes_no_default, answer_is_yes_no_quit):
diff --git a/util/http.c b/util/http.c
index e981fff4a..3ebf30779 100644
--- a/util/http.c
+++ b/util/http.c
@@ -504,7 +504,7 @@ send_request( HTTP_HD hd )
return G10ERR_NETWORK;
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 ) {
sprintf( request, "%s http://%s:%hu%s%s HTTP/1.0\r\n",
hd->req_type == HTTP_REQ_GET ? "GET" :
@@ -513,11 +513,11 @@ send_request( HTTP_HD hd )
server, port, *p == '/'? "":"/", p );
}
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_HEAD? "HEAD":
hd->req_type == HTTP_REQ_POST? "POST": "OOPS",
- *p == '/'? "":"/", p );
+ *p == '/'? "":"/", p, server);
}
m_free(p);
@@ -528,8 +528,6 @@ send_request( HTTP_HD hd )
}
-
-
/****************
* Build the relative path from the parsed URI.
* Minimal implementation.