From bfcaf15075ecc19b4634b0c3cd4ed4dc5b2947e0 Mon Sep 17 00:00:00 2001 From: waken <33921191+mc373906408@users.noreply.github.com> Date: Sun, 4 Feb 2024 23:11:18 +0800 Subject: [PATCH] Ignore localhost address when get icecand for webrtc from http request (#3282) --- server/WebApi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/WebApi.cpp b/server/WebApi.cpp index d317cca8..96a49c04 100755 --- a/server/WebApi.cpp +++ b/server/WebApi.cpp @@ -1750,7 +1750,7 @@ void installWebApi() { std::string host = allArgs.getParser()["Host"]; std::string localIp = host.substr(0, host.find(':')); std::regex ipv4Regex("^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"); - if (!std::regex_match(localIp, ipv4Regex)) { + if (!std::regex_match(localIp, ipv4Regex)||localIp=="127.0.0.1") { localIp = ""; }