aboutsummaryrefslogtreecommitdiff
path: root/src/url.c
diff options
context:
space:
mode:
authorcorvid <corvid@lavabit.com>2011-11-11 18:18:23 +0000
committercorvid <corvid@lavabit.com>2011-11-11 18:18:23 +0000
commit93018bb0f735888fd66de3ce5a46de3daf918a43 (patch)
tree3468f474868efee54ea0a9a5f801576ba8f6a0c0 /src/url.c
parent546bb6fcafd963993d8588d48cad03931d6f6e27 (diff)
fix IPv6 addr recognition
I was under the impression that the brackets were part of the host syntax, but a_Url_hostname() shows that they are part of the _authority_ and are stripped out when making the hostname.
Diffstat (limited to 'src/url.c')
-rw-r--r--src/url.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/url.c b/src/url.c
index 27c97d1c..7d3880ac 100644
--- a/src/url.c
+++ b/src/url.c
@@ -652,10 +652,10 @@ static bool_t Url_host_is_ip(const char *host)
_MSG("an IPv4 address\n");
return TRUE;
}
- if (*host == '[' &&
+ if (strchr(host, ':') &&
(len == strspn(host, "0123456789abcdefABCDEF:.[]"))) {
/* The precise format is shown in section 3.2.2 of rfc 3986 */
- _MSG("an IPv6 address\n");
+ MSG("an IPv6 address\n");
return TRUE;
}
return FALSE;