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

AK+Everywhere: Replace "protocol" with "scheme" url helpers

URL had properly named replacements for protocol(), set_protocol() and
create_with_file_protocol() already. This patch removes these function
and updates all call sites to use the functions named according to the
specification.

See https://url.spec.whatwg.org/#concept-url-scheme
This commit is contained in:
networkException 2022-09-29 01:30:58 +02:00 committed by Linus Groh
parent 454bf1fde0
commit 4230dbbb21
61 changed files with 113 additions and 116 deletions

View file

@ -52,7 +52,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<WebSocket>> WebSocket::create_with_global_o
AK::URL url_record(url);
if (!url_record.is_valid())
return WebIDL::SyntaxError::create(window, "Invalid URL");
if (!url_record.protocol().is_one_of("ws", "wss"))
if (!url_record.scheme().is_one_of("ws", "wss"))
return WebIDL::SyntaxError::create(window, "Invalid protocol");
if (!url_record.fragment().is_empty())
return WebIDL::SyntaxError::create(window, "Presence of URL fragment is invalid");