Skip to content

Commit 89519c8

Browse files
committed
Fix #874
1 parent ff813bf commit 89519c8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

httplib.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ using socket_t = int;
204204
#include <string>
205205
#include <sys/stat.h>
206206
#include <thread>
207+
#include <set>
207208

208209
#ifdef CPPHTTPLIB_OPENSSL_SUPPORT
209210
#include <openssl/err.h>
@@ -3171,7 +3172,14 @@ inline std::string append_query_params(const char *path, const Params &params) {
31713172
}
31723173

31733174
inline void parse_query_text(const std::string &s, Params &params) {
3175+
std::set<std::string> cache;
31743176
split(s.data(), s.data() + s.size(), '&', [&](const char *b, const char *e) {
3177+
std::string kv(b, e);
3178+
if (cache.find(kv) != cache.end()) {
3179+
return;
3180+
}
3181+
cache.insert(kv);
3182+
31753183
std::string key;
31763184
std::string val;
31773185
split(b, e, '=', [&](const char *b2, const char *e2) {

0 commit comments

Comments
 (0)