| 3928 | } |
| 3929 | |
| 3930 | inline void parse_query_text(const std::string &s, Params ¶ms) { |
| 3931 | std::set<std::string> cache; |
| 3932 | split(s.data(), s.data() + s.size(), '&', [&](const char *b, const char *e) { |
| 3933 | std::string kv(b, e); |
| 3934 | if (cache.find(kv) != cache.end()) { return; } |
| 3935 | cache.insert(kv); |
| 3936 | |
| 3937 | std::string key; |
| 3938 | std::string val; |
| 3939 | split(b, e, '=', [&](const char *b2, const char *e2) { |
| 3940 | if (key.empty()) { |
| 3941 | key.assign(b2, e2); |
| 3942 | } else { |
| 3943 | val.assign(b2, e2); |
| 3944 | } |
| 3945 | }); |
| 3946 | |
| 3947 | if (!key.empty()) { |
| 3948 | params.emplace(decode_url(key, true), decode_url(val, true)); |
| 3949 | } |
| 3950 | }); |
| 3951 | } |
| 3952 | |
| 3953 | inline bool parse_multipart_boundary(const std::string &content_type, |
| 3954 | std::string &boundary) { |