mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2026-11-03 02:02:24 +00:00
Enhancements
Fix compatibility problem with some non-standard subscriptions. Add support for specifying token for each profile.
This commit is contained in:
2 files changed
+47
-28
No files matched your search
+19
-1
@@ -1664,7 +1664,7 @@ std::string surgeConfToClash(RESPONSE_CALLBACK_ARGS)
|
||||
std::string getProfile(RESPONSE_CALLBACK_ARGS)
|
||||
{
|
||||
std::string name = UrlDecode(getUrlArg(argument, "name")), token = UrlDecode(getUrlArg(argument, "token")), expand = getUrlArg(argument, "expand");
|
||||
if(token != access_token)
|
||||
if(token.empty() || name.empty())
|
||||
{
|
||||
*status_code = 403;
|
||||
return "Forbidden";
|
||||
@@ -1695,6 +1695,24 @@ std::string getProfile(RESPONSE_CALLBACK_ARGS)
|
||||
*status_code = 500;
|
||||
return "Broken profile!";
|
||||
}
|
||||
auto profile_token = contents.find("profile_token");
|
||||
if(profile_token != contents.end())
|
||||
{
|
||||
if(token != profile_token->second)
|
||||
{
|
||||
*status_code = 403;
|
||||
return "Forbidden";
|
||||
}
|
||||
token = access_token;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(token != access_token)
|
||||
{
|
||||
*status_code = 403;
|
||||
return "Forbidden";
|
||||
}
|
||||
}
|
||||
contents.emplace("token", token);
|
||||
contents.emplace("expand", expand);
|
||||
std::string query;
|
||||
|
||||
Reference in new issue
Block a user