| 12868 | } |
| 12869 | |
| 12870 | void url::set_search(const std::string_view input) { |
| 12871 | if (input.empty()) { |
| 12872 | query = std::nullopt; |
| 12873 | helpers::strip_trailing_spaces_from_opaque_path(*this); |
| 12874 | return; |
| 12875 | } |
| 12876 | |
| 12877 | std::string new_value; |
| 12878 | new_value = input[0] == '?' ? input.substr(1) : input; |
| 12879 | helpers::remove_ascii_tab_or_newline(new_value); |
| 12880 | |
| 12881 | auto query_percent_encode_set = |
| 12882 | is_special() ? ada::character_sets::SPECIAL_QUERY_PERCENT_ENCODE |
| 12883 | : ada::character_sets::QUERY_PERCENT_ENCODE; |
| 12884 | |
| 12885 | query = ada::unicode::percent_encode(new_value, query_percent_encode_set); |
| 12886 | } |
| 12887 | |
| 12888 | bool url::set_pathname(const std::string_view input) { |
| 12889 | if (has_opaque_path) { |
no test coverage detected