diff --git a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Responses.cpp b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Responses.cpp index f800ab44ed..679bf100db 100644 --- a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Responses.cpp +++ b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Responses.cpp @@ -4,6 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include #include #include @@ -103,7 +104,8 @@ ErrorOr> Response::location_url(Optional const& reques return Optional {}; // 3. If location is a header value, then set location to the result of parsing location with response’s URL. - auto location = AK::URL { StringView { location_values->first() } }; + auto base_url = *url(); + auto location = AK::URLParser::parse(location_values->first(), &base_url); if (!location.is_valid()) return Error::from_string_view("Invalid 'Location' header URL"sv);