|
@@ -4,6 +4,7 @@
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
*/
|
|
|
|
|
|
+#include <AK/URLParser.h>
|
|
|
#include <LibJS/Heap/Heap.h>
|
|
|
#include <LibJS/Runtime/VM.h>
|
|
|
#include <LibWeb/Bindings/MainThreadVM.h>
|
|
@@ -103,7 +104,8 @@ ErrorOr<Optional<AK::URL>> Response::location_url(Optional<String> const& reques
|
|
|
return Optional<AK::URL> {};
|
|
|
|
|
|
// 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);
|
|
|
|