mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2026-11-03 02:02:24 +00:00
Enhancements
Fix not processing quotes in ws-headers in Surge VMess configurations. Fix when default_url is set and insert_url is not set in YAML configuration and access /sub without url argument, the nodes in default_url will be added twice. Add /version interface to compatible with some front-end.
This commit is contained in:
6 files changed
+39
-16
No files matched your search
+13
-3
@@ -438,14 +438,14 @@ std::string getSystemProxy()
|
||||
#endif // _WIN32
|
||||
}
|
||||
|
||||
std::string trim(const std::string& str)
|
||||
std::string trim_of(const std::string& str, char target)
|
||||
{
|
||||
std::string::size_type pos = str.find_first_not_of(' ');
|
||||
std::string::size_type pos = str.find_first_not_of(target);
|
||||
if (pos == std::string::npos)
|
||||
{
|
||||
return str;
|
||||
}
|
||||
std::string::size_type pos2 = str.find_last_not_of(' ');
|
||||
std::string::size_type pos2 = str.find_last_not_of(target);
|
||||
if (pos2 != std::string::npos)
|
||||
{
|
||||
return str.substr(pos, pos2 - pos + 1);
|
||||
@@ -453,6 +453,16 @@ std::string trim(const std::string& str)
|
||||
return str.substr(pos);
|
||||
}
|
||||
|
||||
std::string trim(const std::string& str)
|
||||
{
|
||||
return trim_of(str, ' ');
|
||||
}
|
||||
|
||||
std::string trim_quote(const std::string &str)
|
||||
{
|
||||
return trim_of(str, '\"');
|
||||
}
|
||||
|
||||
std::string getUrlArg(const std::string &url, const std::string &request)
|
||||
{
|
||||
//std::smatch result;
|
||||
|
||||
Reference in new issue
Block a user