mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:27:35 +00:00
AK: Port URL scheme from DeprecatedString to String
This commit is contained in:
parent
21fe86d235
commit
c25485700a
16 changed files with 30 additions and 30 deletions
|
@ -266,7 +266,7 @@ WebIDL::ExceptionOr<Optional<JS::NonnullGCPtr<PendingResponse>>> main_fetch(JS::
|
|||
&& false
|
||||
|
||||
) {
|
||||
request->current_url().set_scheme("https"sv);
|
||||
request->current_url().set_scheme("https"_string);
|
||||
}
|
||||
|
||||
JS::SafeFunction<WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>>()> get_response = [&realm, &vm, &fetch_params, request]() -> WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> {
|
||||
|
|
|
@ -31,7 +31,7 @@ WebIDL::ExceptionOr<String> WorkerLocation::protocol() const
|
|||
{
|
||||
auto& vm = realm().vm();
|
||||
// The protocol getter steps are to return this's WorkerGlobalScope object's url's scheme, followed by ":".
|
||||
return TRY_OR_THROW_OOM(vm, String::formatted("{}:", m_global_scope->url().scheme().view()));
|
||||
return TRY_OR_THROW_OOM(vm, String::formatted("{}:", m_global_scope->url().scheme()));
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/workers.html#dom-workerlocation-host
|
||||
|
|
|
@ -513,14 +513,14 @@ HTML::Origin url_origin(AK::URL const& url)
|
|||
// -> "wss"
|
||||
if (url.scheme().is_one_of("ftp"sv, "http"sv, "https"sv, "ws"sv, "wss"sv)) {
|
||||
// Return the tuple origin (url’s scheme, url’s host, url’s port, null).
|
||||
return HTML::Origin(url.scheme(), url.host(), url.port().value_or(0));
|
||||
return HTML::Origin(url.scheme().to_deprecated_string(), url.host(), url.port().value_or(0));
|
||||
}
|
||||
|
||||
// -> "file"
|
||||
if (url.scheme() == "file"sv) {
|
||||
// Unfortunate as it is, this is left as an exercise to the reader. When in doubt, return a new opaque origin.
|
||||
// Note: We must return an origin with the `file://' protocol for `file://' iframes to work from `file://' pages.
|
||||
return HTML::Origin(url.scheme(), String {}, 0);
|
||||
return HTML::Origin(url.scheme().to_deprecated_string(), String {}, 0);
|
||||
}
|
||||
|
||||
// -> Otherwise
|
||||
|
|
|
@ -69,10 +69,10 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<WebSocket>> WebSocket::construct_impl(JS::R
|
|||
|
||||
// 4. If urlRecord’s scheme is "http", then set urlRecord’s scheme to "ws".
|
||||
if (url_record.scheme() == "http"sv)
|
||||
url_record.set_scheme("ws"sv);
|
||||
url_record.set_scheme("ws"_string);
|
||||
// 5. Otherwise, if urlRecord’s scheme is "https", set urlRecord’s scheme to "wss".
|
||||
else if (url_record.scheme() == "https"sv)
|
||||
url_record.set_scheme("wss"sv);
|
||||
url_record.set_scheme("wss"_string);
|
||||
|
||||
// 6. If urlRecord’s scheme is not "ws" or "wss", then throw a "SyntaxError" DOMException.
|
||||
if (!url_record.scheme().is_one_of("ws"sv, "wss"sv))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue