1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:57:45 +00:00

LibWeb/Fetch: Port infrastructure to new String

This commit is contained in:
Linus Groh 2023-03-02 23:26:35 +00:00
parent 7f9ddcf420
commit 11023a3c53
20 changed files with 144 additions and 142 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, Linus Groh <linusg@serenityos.org>
* Copyright (c) 2022-2023, Linus Groh <linusg@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -56,11 +56,11 @@ ErrorOr<bool> tao_check(Infrastructure::Request const& request, Infrastructure::
auto values = TRY(response.header_list()->get_decode_and_split("Timing-Allow-Origin"sv.bytes()));
// 3. If values contains "*", then return success.
if (values.has_value() && values->contains_slow("*"sv))
if (values.has_value() && values->contains_slow("*"_short_string))
return true;
// 4. If values contains the result of serializing a request origin with request, then return success.
if (values.has_value() && values->contains_slow(request.serialize_origin()))
if (values.has_value() && values->contains_slow(TRY(request.serialize_origin())))
return true;
// 5. If requests mode is "navigate" and requests current URLs origin is not same origin with requests origin, then return failure.