| 259 | } |
| 260 | |
| 261 | tl::expected<std::string, errors> url_pattern_init::process_protocol( |
| 262 | std::string_view value, process_type type) { |
| 263 | ada_log("process_protocol=", value, " [", type, "]"); |
| 264 | // Let strippedValue be the given value with a single trailing U+003A (:) |
| 265 | // removed, if any. |
| 266 | if (value.ends_with(":")) { |
| 267 | value.remove_suffix(1); |
| 268 | } |
| 269 | // If type is "pattern" then return strippedValue. |
| 270 | if (type == process_type::pattern) { |
| 271 | return std::string(value); |
| 272 | } |
| 273 | // Return the result of running canonicalize a protocol given strippedValue. |
| 274 | return url_pattern_helpers::canonicalize_protocol(value); |
| 275 | } |
| 276 | |
| 277 | tl::expected<std::string, errors> url_pattern_init::process_username( |
| 278 | std::string_view value, process_type type) { |
nothing calls this directly
no test coverage detected