mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 12:49:19 +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:
parent
dd392dfa03
commit
8a938a3e25
Notes:
sideshowbarker
2024-07-18 17:04:28 +09:00
Author: https://github.com/MaxWipfli
Commit: 8a938a3e25
Pull-request: https://github.com/SerenityOS/serenity/pull/7478
Reviewed-by: https://github.com/awesomekling
2 changed files with 20 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue