mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-31 13:00:49 +00:00
Include ipv6 wrapping brackets [] in the result of mg_url_host()
This commit is contained in:
1 parent
8652006aea
commit
90a131bd29
5 files changed
+10
-15
No files matched your search
@@ -87,6 +87,7 @@ static bool mg_v4mapped(struct mg_str str, struct mg_addr *addr) {
|
||||
|
||||
static bool mg_aton6(struct mg_str str, struct mg_addr *addr) {
|
||||
size_t i, j = 0, n = 0, dc = 42;
|
||||
if (str.len > 2 && str.ptr[0] == '[') str.ptr++, str.len -= 2;
|
||||
if (mg_v4mapped(str, addr)) return true;
|
||||
for (i = 0; i < str.len; i++) {
|
||||
if ((str.ptr[i] >= '0' && str.ptr[i] <= '9') ||
|
||||
|
||||
Reference in new issue
Block a user