aboutsummaryrefslogtreecommitdiff
path: root/src/supplemental/tcp
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2020-07-26 16:45:11 -0700
committerGarrett D'Amore <garrett@damore.org>2020-07-27 19:15:08 -0700
commit09d667c49383edb980bcac88de1173c452066128 (patch)
treea9732fcf561032c1a10fcc3a3067404046bcc3b7 /src/supplemental/tcp
parent166981244eec7699190bf8b70c32ffe99e485b72 (diff)
downloadnng-09d667c49383edb980bcac88de1173c452066128.tar.gz
nng-09d667c49383edb980bcac88de1173c452066128.tar.bz2
nng-09d667c49383edb980bcac88de1173c452066128.zip
fixes #844 WebSocket wildcard host errors
fixes #1224 wss fails on IPV6 address This fixes bugs and inconsistencies in the way addresses are handled for HTTP (and consequently websocket). The Host: address line needs to look at numeric IPs and treat wildcards as if they are not specified, and needs to understand the IPv6 address format using brackets (e.g. [::1]:80).
Diffstat (limited to 'src/supplemental/tcp')
-rw-r--r--src/supplemental/tcp/tcp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/supplemental/tcp/tcp.c b/src/supplemental/tcp/tcp.c
index dd6f28ff..2fb7f56d 100644
--- a/src/supplemental/tcp/tcp.c
+++ b/src/supplemental/tcp/tcp.c
@@ -439,7 +439,7 @@ nni_tcp_listener_alloc(nng_stream_listener **lp, const nng_url *url)
h = url->u_hostname;
// Wildcard special case, which means bind to INADDR_ANY.
- if ((h != NULL) && ((strcmp(h, "*") == 0) || (strlen(h) == 0))) {
+ if ((h != NULL) && ((strcmp(h, "*") == 0) || (strcmp(h, "") == 0))) {
h = NULL;
}
nni_tcp_resolv(h, url->u_port, af, 1, aio);