From d2deb8fa6d5ca23e859f5b49c0ad67bc22cd83d1 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sun, 30 Oct 2022 14:40:23 +0000 Subject: [PATCH] LibWeb: Add has-cross-origin-redirects flag to Fetch::Infra::Response This is a change in the Fetch spec. See: https://github.com/whatwg/fetch/commit/7c30987 --- .../Libraries/LibWeb/Fetch/Infrastructure/HTTP/Responses.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Responses.h b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Responses.h index 589bcbbc0f..02edc09230 100644 --- a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Responses.h +++ b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Responses.h @@ -95,6 +95,9 @@ public: [[nodiscard]] virtual BodyInfo const& body_info() const { return m_body_info; } void set_body_info(BodyInfo body_info) { m_body_info = body_info; } + [[nodiscard]] bool has_cross_origin_redirects() const { return m_has_cross_origin_redirects; } + void set_has_cross_origin_redirects(bool has_cross_origin_redirects) { m_has_cross_origin_redirects = has_cross_origin_redirects; } + [[nodiscard]] bool is_aborted_network_error() const; [[nodiscard]] bool is_network_error() const; @@ -163,6 +166,10 @@ private: // https://fetch.spec.whatwg.org/#response-service-worker-timing-info // FIXME: A response has an associated service worker timing info (null or a service worker timing info), which is initially null. + + // https://fetch.spec.whatwg.org/#response-has-cross-origin-redirects + // A response has an associated has-cross-origin-redirects (a boolean), which is initially false. + bool m_has_cross_origin_redirects { false }; }; // https://fetch.spec.whatwg.org/#concept-filtered-response