Enhanced to include port number (if not == 80) on the "Header:" URL (bug
* nanohttp.c: Enhanced to include port number (if not == 80) on the
"Header:" URL (bug #469681).
* xmlregexp.c: Fixed a typo causing a warning message.
svn path=/trunk/; revision=3657
diff --git a/nanohttp.c b/nanohttp.c
index e7b601a..91c7e87 100644
--- a/nanohttp.c
+++ b/nanohttp.c
@@ -1364,8 +1364,13 @@
if (ctxt->query != NULL)
p += snprintf( p, blen - (p - bp), "?%s", ctxt->query);
- p += snprintf( p, blen - (p - bp), " HTTP/1.0\r\nHost: %s\r\n",
+ if (ctxt->port == 80) {
+ p += snprintf( p, blen - (p - bp), " HTTP/1.0\r\nHost: %s\r\n",
ctxt->hostname);
+ } else {
+ p += snprintf( p, blen - (p - bp), " HTTP/1.0\r\nHost: %s:%d\r\n",
+ ctxt->hostname, ctxt->port);
+ }
#ifdef HAVE_ZLIB_H
p += snprintf(p, blen - (p - bp), "Accept-Encoding: gzip\r\n");