diff --git a/src/output/output_http_internal.cpp b/src/output/output_http_internal.cpp index 8962d581..de46b06b 100644 --- a/src/output/output_http_internal.cpp +++ b/src/output/output_http_internal.cpp @@ -266,8 +266,8 @@ namespace Mist { // send smil MBR index if (H.url.length() > 6 && H.url.substr(H.url.length() - 5, 5) == ".smil"){ std::string host = H.GetHeader("Host"); - if (host.find(':')){ - host.resize(host.find(':')); + if (host.rfind(':') != std::string::npos && *host.rbegin() != ']'){ + host.resize(host.rfind(':')); } std::string port, url_rel; @@ -326,8 +326,8 @@ namespace Mist { std::string response; std::string rURL = H.url; std::string host = H.GetHeader("Host"); - if (host.find(':') != std::string::npos){ - host.resize(host.find(':')); + if (host.rfind(':') != std::string::npos && *host.rbegin() != ']'){ + host.resize(host.rfind(':')); } H.Clean(); H.SetHeader("Server", "MistServer/" PACKAGE_VERSION);