LibWeb/Fetch: Don’t cache redirects

This change disables caching for 301, 302, 303, 307, and 308 responses.
This is just for now, ad-hoc — not adhering to any particular spec.
Fixes https://github.com/LadybirdBrowser/ladybird/issues/863
This commit is contained in:
sideshowbarker 2024-07-30 18:36:57 +09:00 committed by Andreas Kling
parent 5f8d852dae
commit f735c464d3
Notes: github-actions[bot] 2024-08-01 09:40:16 +00:00

View file

@ -1459,6 +1459,10 @@ private:
// FIXME: Implement must-understand cache directive
}
// FIXME: This is just for now, ad-hoc — not adhering to any particular spec.
if (response.status() == 301 || response.status() == 302 || response.status() == 303 || response.status() == 307 || response.status() == 308)
return false;
// - the no-store cache directive is not present in the response (see Section 5.2.2.5);
if (request.cache_mode() == Infrastructure::Request::CacheMode::NoStore)
return false;