MCPcopy Create free account
hub / github.com/ada-url/ada / process_protocol

Method process_protocol

src/url_pattern.cpp:261–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259}
260
261tl::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
277tl::expected<std::string, errors> url_pattern_init::process_username(
278 std::string_view value, process_type type) {

Callers

nothing calls this directly

Calls 1

canonicalize_protocolFunction · 0.85

Tested by

no test coverage detected