1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:47:46 +00:00

AK: Add helper functions and private data URL constructor to URL

This adds a few helper functions and a private constructor to
instantiate a data URL to the URL class. These will be needed by the
upcoming URL parser.
This commit is contained in:
Max Wipfli 2021-05-25 22:05:01 +02:00 committed by Andreas Kling
parent dd392dfa03
commit 8a938a3e25
2 changed files with 20 additions and 0 deletions

View file

@ -513,6 +513,12 @@ URL URL::create_with_data(const StringView& mime_type, const StringView& payload
return url;
}
// https://url.spec.whatwg.org/#special-scheme
bool URL::is_special_scheme(const StringView& scheme)
{
return scheme.is_one_of("ftp", "file", "http", "https", "ws", "wss");
}
String URL::basename() const
{
if (!m_valid)