| 3689 | } |
| 3690 | |
| 3691 | inline void parse_query_text(const std::string &s, Params ¶ms) { |
| 3692 | std::set<std::string> cache; |
| 3693 | split(s.data(), s.data() + s.size(), '&', [&](const char *b, const char *e) { |
| 3694 | std::string kv(b, e); |
| 3695 | if (cache.find(kv) != cache.end()) { return; } |
| 3696 | cache.insert(kv); |
| 3697 | |
| 3698 | std::string key; |
| 3699 | std::string val; |
| 3700 | split(b, e, '=', [&](const char *b2, const char *e2) { |
| 3701 | if (key.empty()) { |
| 3702 | key.assign(b2, e2); |
| 3703 | } else { |
| 3704 | val.assign(b2, e2); |
| 3705 | } |
| 3706 | }); |
| 3707 | |
| 3708 | if (!key.empty()) { |
| 3709 | params.emplace(decode_url(key, true), decode_url(val, true)); |
| 3710 | } |
| 3711 | }); |
| 3712 | } |
| 3713 | |
| 3714 | inline bool parse_multipart_boundary(const std::string &content_type, |
| 3715 | std::string &boundary) { |