mod audio fork cannot parse ws:<IP>/call path (#40)

* mod audio fork cannot parse ws:<IP>/call path

Signed-off-by: Quan HL <quan.luuhoang8@gmail.com>

* add comments for the regex

Signed-off-by: Quan HL <quan.luuhoang8@gmail.com>

* add comments for the regex

Signed-off-by: Quan HL <quan.luuhoang8@gmail.com>

---------

Signed-off-by: Quan HL <quan.luuhoang8@gmail.com>
This commit is contained in:
Hoan Luu Huu
2024-04-09 07:03:01 +07:00
committed by GitHub
parent 4aabb36a64
commit 2bbc18903c

View File

@@ -419,7 +419,10 @@ extern "C" {
}
std::string strHost(server + offset);
std::regex re("^(.+?):?(\\d+)?(/.*)?$");
//- `([^/:]+)` captures the hostname/IP address, match any character except in the set
//- `:?([0-9]*)?` optionally captures a colon and the port number, if it's present.
//- `(/.*)` captures everything else (the path).
std::regex re("([^/:]+):?([0-9]*)?(/.*)?$");
std::smatch matches;
if(std::regex_search(strHost, matches, re)) {
/*