Skip to content
Snippets Groups Projects
Commit 595d35f5 authored by Hangzhi Yu's avatar Hangzhi Yu
Browse files

Change range of valid response status codes in SW

parent 2a506a0c
No related branches found
No related tags found
3 merge requests!1237Release 3.0,!1193Resolve "SW delivers offline fallback page when status code is not between 200-299 (response.ok)",!1183Release 3.0
Pipeline #116110 passed
......@@ -6,6 +6,16 @@ All notable changes to this project will be documented in this file.
The format is based on `Keep a Changelog`_,
and this project adheres to `Semantic Versioning`_.
Unreleased
----------
Fixed
~~~~~
* In case the status code of a response was not in the range between 200 and 299
but still indicates that the response should be delivered, e. g. in the case
of a redirected request, the service worker served the offline fallback page.
`3.0b1` - 2023-02-27
--------------------
......
......@@ -239,7 +239,7 @@ export default defineConfig({
plugins: [
{
fetchDidSucceed: async ({ request, response }) => {
if (response.ok) {
if (response.status < 400) {
return response;
}
throw new Error(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment