MCPcopy Create free account
hub / github.com/Windscribe/Desktop-App / normalizeAddress

Function normalizeAddress

src/helper/common/validation_posix.cpp:346–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

344}
345
346std::string normalizeAddress(const std::string &address)
347{
348 std::string addr = address;
349
350 if (isValidIpv4Address(address)) {
351 return addr;
352 }
353
354 if (isValidDomain(address)) {
355 return addr;
356 }
357
358 auto url = skyr::parse(address);
359 if (!url) {
360 return "";
361 }
362
363 return skyr::serialize(url.value());
364}
365
366bool isPrintableSingleLineAscii(const std::string &v)
367{

Callers 2

startCtrldFunction · 0.85
startCtrldFunction · 0.85

Calls 3

isValidIpv4AddressFunction · 0.85
isValidDomainFunction · 0.85
serializeFunction · 0.85

Tested by

no test coverage detected