- From: ayZagen <notifications@github.com>
- Date: Tue, 31 Mar 2020 08:30:36 -0700
- To: whatwg/fetch <fetch@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Tuesday, 31 March 2020 15:30:49 UTC
Please have a look at the example below
```js
fetch('https://httpstat.us/500', {
cache: 'no-cache',
headers: {
"AnyHeader": "value"
}
})
.then(function(response) {
if (!response.ok) {
throw Error(response.statusText);
}
return response;
}).then(function(response) {
console.log('ok');
}).catch(function(error) {
// Promise rejected with TypeError: Failed to fetch
console.log(error);
});
```
If we remove the `AnyHeader` header the promise will not be rejected.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/1014
Received on Tuesday, 31 March 2020 15:30:49 UTC