summaryrefslogtreecommitdiff
path: root/sys/src/cmd/webfs/http.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2019-03-23 00:49:07 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2019-03-23 00:49:07 +0100
commit151039caf055a741c69656ae9034b4829e4d6c94 (patch)
treeff83464daf054af30218ddfb802cdfb9df287a66 /sys/src/cmd/webfs/http.c
parent1e97adc86b3ca9ef5c9834fa802e4003df1b86e2 (diff)
webfs: bracket literal ipv6 host in "Host:" header
Diffstat (limited to 'sys/src/cmd/webfs/http.c')
-rw-r--r--sys/src/cmd/webfs/http.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/src/cmd/webfs/http.c b/sys/src/cmd/webfs/http.c
index 907035bcc..58a0df91c 100644
--- a/sys/src/cmd/webfs/http.c
+++ b/sys/src/cmd/webfs/http.c
@@ -637,7 +637,7 @@ http(char *m, Url *u, Key *shdr, Buq *qbody, Buq *qpost)
ru.path = Upath(u);
ru.query = u->query;
}
- n = snprint(buf, sizeof(buf), "%s %U HTTP/1.1\r\nHost: %s%s%s\r\n",
+ n = snprint(buf, sizeof(buf), "%s %U HTTP/1.1\r\nHost: %]%s%s\r\n",
method, &ru, host, u->port ? ":" : "", u->port ? u->port : "");
if(n >= sizeof(buf)-64){
werrstr("request too large");
@@ -649,7 +649,7 @@ http(char *m, Url *u, Key *shdr, Buq *qbody, Buq *qpost)
break;
}
if(h->tunnel){
- n = snprint(buf, sizeof(buf), "CONNECT %s:%s HTTP/1.1\r\nHost: %s:%s\r\n",
+ n = snprint(buf, sizeof(buf), "CONNECT %]:%s HTTP/1.1\r\nHost: %]:%s\r\n",
host, u->port ? u->port : "443",
host, u->port ? u->port : "443");
}