Does fetch follow HTTP 30x redirects?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Yes. Check this.
Checking to see if the response comes from a redirected request is as simple as checking this flag on the Response object.
if (response.redirected) {
//...
}
You can disable it:
fetch("awesome-picture.jpg", { redirect: "error" }).then(function(response) {
//some stuff
}).then(function(imageBlob) {
//some other stuff
});