mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:17:35 +00:00
LibWeb: Add definitions from '2.1. URL' in the Fetch spec
This commit is contained in:
parent
de74ba587f
commit
7c2c9b6859
3 changed files with 53 additions and 0 deletions
18
Userland/Libraries/LibWeb/Fetch/Infrastructure/URL.cpp
Normal file
18
Userland/Libraries/LibWeb/Fetch/Infrastructure/URL.cpp
Normal file
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Linus Groh <linusg@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/Fetch/Infrastructure/URL.h>
|
||||
|
||||
namespace Web::Fetch {
|
||||
|
||||
// https://fetch.spec.whatwg.org/#is-local
|
||||
bool is_local_url(AK::URL const& url)
|
||||
{
|
||||
// A URL is local if its scheme is a local scheme.
|
||||
return any_of(LOCAL_SCHEMES, [&](auto scheme) { return url.scheme() == scheme; });
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue