| 383 | } |
| 384 | |
| 385 | void Webserver::BuildArgumentMap(const string& args, ArgumentMap* output) { |
| 386 | vector<string> arg_pairs; |
| 387 | split(arg_pairs, args, is_any_of("&")); |
| 388 | |
| 389 | for (const string& arg_pair: arg_pairs) { |
| 390 | vector<string> key_value; |
| 391 | split(key_value, arg_pair, is_any_of("=")); |
| 392 | if (key_value.empty()) continue; |
| 393 | |
| 394 | string key; |
| 395 | if (!UrlDecode(key_value[0], &key)) continue; |
| 396 | string value; |
| 397 | if (!UrlDecode((key_value.size() >= 2 ? key_value[1] : ""), &value)) continue; |
| 398 | to_lower(key); |
| 399 | (*output)[key] = value; |
| 400 | } |
| 401 | } |
| 402 | |
| 403 | bool Webserver::IsSecure() const { |
| 404 | return !FLAGS_webserver_certificate_file.empty(); |