aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2000-07-25 07:28:28 +0000
committerDaniel Stenberg <daniel@haxx.se>2000-07-25 07:28:28 +0000
commite999182758f809fb8a173c0caec2283d4bbfe280 (patch)
tree4e396fa233086ef8eed8efee7708cd58b9dffddb
parentd9c41a0ffd37fa3f4e7009d71ffd1d11fbc0889c (diff)
The Host: header now includes the port number if not default HTTP
-rw-r--r--lib/http.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/http.c b/lib/http.c
index d83942d1d..c3fb857d8 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -269,9 +269,12 @@ CURLcode http(struct connectdata *conn)
http->sendit = getFormData(data->httppost, &http->postsize);
}
- if(!checkheaders(data, "Host:"))
- data->ptr_host = maprintf("Host: %s\r\n", host);
-
+ if(!checkheaders(data, "Host:")) {
+ if(data->port != PORT_HTTP)
+ data->ptr_host = maprintf("Host: %s:%d\r\n", host, data->port);
+ else
+ data->ptr_host = maprintf("Host: %s\r\n", host);
+ }
if(!checkheaders(data, "Pragma:"))
http->p_pragma = "Pragma: no-cache\r\n";