| 16112 | } |
| 16113 | |
| 16114 | tl::expected<std::string, errors> canonicalize_password( |
| 16115 | std::string_view input) { |
| 16116 | // If value is the empty string, return value. |
| 16117 | if (input.empty()) [[unlikely]] { |
| 16118 | return ""; |
| 16119 | } |
| 16120 | // Let dummyURL be a new URL record. |
| 16121 | // Set the password given dummyURL and value. |
| 16122 | auto url = ada::parse<url_aggregator>("fake://dummy.test", nullptr); |
| 16123 | |
| 16124 | ADA_ASSERT_TRUE(url.has_value()); |
| 16125 | if (!url->set_password(input)) { |
| 16126 | return tl::unexpected(errors::type_error); |
| 16127 | } |
| 16128 | // Return dummyURL's password. |
| 16129 | return std::string(url->get_password()); |
| 16130 | } |
| 16131 | |
| 16132 | tl::expected<std::string, errors> canonicalize_hostname( |
| 16133 | std::string_view input) { |
no test coverage detected