1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 15:54:58 +00:00

LibWeb: Complete the redirect URL before loading it

the "Location" header is allowed to be a relative URL (as is the case in
our very own WebServer!)
This commit is contained in:
AnotherTest 2020-07-30 04:29:39 +04:30 committed by Andreas Kling
parent 8e8cbe6a12
commit 1df9293ea4

View file

@ -212,7 +212,7 @@ void FrameLoader::resource_did_load()
// FIXME: Also check HTTP status code before redirecting
auto location = resource()->response_headers().get("Location");
if (location.has_value()) {
load(location.value(), FrameLoader::Type::Navigation);
load(url.complete_url(location.value()), FrameLoader::Type::Navigation);
return;
}