GoogleChromeLabs / sw-toolbox

[Deprecated] A collection of service worker tools for offlining runtime requests
https://developers.google.com/web/tools/workbox/guides/migrations/migrate-from-sw
Apache License 2.0
3.62k stars 332 forks source link

the variable successResponses' s value /^0|([123]\d\d)|(40[14567])|410$/ is wrong for 404 #246

Open tangpo opened 7 years ago

tangpo commented 7 years ago

in fetchAndCache method , when the fetch method return response Object that the status is 404, the successResponses.test(response.status) is also return true.

Is this a bug?

中文版:fetchAndCache方法里面,当通过fetch方法获取一个不存在的文件,即返回404状态码时,这语句request.method === 'GET' && successResponses.test(response.status) 也校验通过,把404 都当成成功响应,请问这个是不是bug。