diff options
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Responses.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Responses.cpp b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Responses.cpp index d523e35f69..398f7fed19 100644 --- a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Responses.cpp +++ b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Responses.cpp @@ -44,23 +44,26 @@ NonnullRefPtr<Response> Response::network_error() bool Response::is_aborted_network_error() const { // A response whose type is "error" and aborted flag is set is known as an aborted network error. - return m_type == Type::Error && m_aborted; + // NOTE: We have to use the virtual getter here to not bypass filtered responses. + return type() == Type::Error && aborted(); } // https://fetch.spec.whatwg.org/#concept-network-error bool Response::is_network_error() const { // A response whose type is "error" is known as a network error. - return m_type == Type::Error; + // NOTE: We have to use the virtual getter here to not bypass filtered responses. + return type() == Type::Error; } // https://fetch.spec.whatwg.org/#concept-response-url Optional<AK::URL const&> Response::url() const { // A response has an associated URL. It is a pointer to the last URL in responseās URL list and null if responseās URL list is empty. - if (m_url_list.is_empty()) + // NOTE: We have to use the virtual getter here to not bypass filtered responses. + if (url_list().is_empty()) return {}; - return m_url_list.last(); + return url_list().last(); } // https://fetch.spec.whatwg.org/#concept-response-location-url @@ -69,7 +72,8 @@ ErrorOr<Optional<AK::URL>> Response::location_url(Optional<String> const& reques // The location URL of a response response, given null or an ASCII string requestFragment, is the value returned by the following steps. They return null, failure, or a URL. // 1. If responseās status is not a redirect status, then return null. - if (!is_redirect_status(m_status)) + // NOTE: We have to use the virtual getter here to not bypass filtered responses. + if (!is_redirect_status(status())) return Optional<AK::URL> {}; // FIXME: 2. Let location be the result of extracting header list values given `Location` and responseās header list. |