feat(UrlUtils): Resolve more URL formats
Resolves more formats of URLs correctly: absolute, root-relative, relative, parent-relative, and URLs with query strings and fragments.
This commit is contained in:
@@ -18,6 +18,13 @@ std::string ensureProtocol(const std::string& url);
|
||||
*/
|
||||
std::string extractHost(const std::string& url);
|
||||
|
||||
/**
|
||||
* Extract hostname only from a URL (e.g., "example.com" from
|
||||
* "http://example.com:8080/path"). Returns an empty string if no hostname can
|
||||
* be determined.
|
||||
*/
|
||||
std::string extractHostname(const std::string& url);
|
||||
|
||||
/**
|
||||
* Build full URL from server URL and path.
|
||||
* If path starts with /, it's an absolute path from the host root.
|
||||
|
||||
Reference in New Issue
Block a user