summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGil Mendes <gil00mendes@gmail.com>2021-06-20 12:22:43 +0100
committerLinus Groh <mail@linusgroh.de>2021-06-20 19:40:46 +0100
commit12f3aa9faa0163a035b3fc021b003a7b025a6a7b (patch)
treed721b21836f6140d41d0e371bdba1d1544f75f9a
parente9388408db8cf939539975ed8df3a66806862ee2 (diff)
downloadserenity-12f3aa9faa0163a035b3fc021b003a7b025a6a7b.zip
LibWeb: Fix redirects when a response has no data
This makes redirects work when the HTTP server responds with just headers and no data.
-rw-r--r--Userland/Libraries/LibWeb/Loader/FrameLoader.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp b/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp
index 36bcf02cbe..f979c97a34 100644
--- a/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp
+++ b/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp
@@ -229,11 +229,6 @@ void FrameLoader::resource_did_load()
{
auto url = resource()->url();
- if (!resource()->has_encoded_data()) {
- load_error_page(url, "No data");
- return;
- }
-
// FIXME: Also check HTTP status code before redirecting
auto location = resource()->response_headers().get("Location");
if (location.has_value()) {
@@ -248,6 +243,11 @@ void FrameLoader::resource_did_load()
}
m_redirects_count = 0;
+ if (!resource()->has_encoded_data()) {
+ load_error_page(url, "No data");
+ return;
+ }
+
if (resource()->has_encoding()) {
dbgln("This content has MIME type '{}', encoding '{}'", resource()->mime_type(), resource()->encoding().value());
} else {