diff --git a/iis/mymodule.cpp b/iis/mymodule.cpp index dfaee4b2c..b1741b14a 100644 --- a/iis/mymodule.cpp +++ b/iis/mymodule.cpp @@ -22,6 +22,7 @@ // IIS7 Server API header file #include #include +#include #include #include "httpserv.h" @@ -104,7 +105,14 @@ char *GetIpAddr(apr_pool_t *pool, PSOCKADDR pAddr) if (GetNameInfo(pAddr, addrSize, buf, NI_MAXHOST, nullptr, 0, NI_NUMERICHOST) != 0) { return apr_pstrdup(pool, ""); } - + + if (pAddr->sa_family == AF_INET6) { + char *zone = strchr(buf, '%'); + if (zone != nullptr) { + *zone = '\0'; + } + } + return buf; }