Enhancements

Fix request parameters are url-decoded twice.
Fix post form request not handled correctly.
This commit is contained in:
Tindy X committed 2023-12-06 15:54:05 +08:00
1 parent 043c1fdcb9
commit 13623d6bcd
4 files changed
+14 -14

No files matched your search

+3 -3
View File
@@ -343,10 +343,10 @@ std::string getUrlArg(const std::string &url, const std::string &request)
return "";
}
std::string getUrlArg(const string_multimap &url, const std::string &request)
std::string getUrlArg(const string_multimap &args, const std::string &request)
{
auto it = url.find(request);
if(it != url.end())
auto it = args.find(request);
if(it != args.end())
return it->second;
return "";
}
+1 -1
View File
@@ -31,7 +31,7 @@ std::string join(InputIt first, InputIt last, const std::string &delimiter)
}
std::string getUrlArg(const std::string &url, const std::string &request);
std::string getUrlArg(const string_multimap &url, const std::string &request);
std::string getUrlArg(const string_multimap &args, const std::string &request);
std::string replaceAllDistinct(std::string str, const std::string &old_value, const std::string &new_value);
std::string trimOf(const std::string& str, char target, bool before = true, bool after = true);
std::string trim(const std::string& str, bool before = true, bool after = true);