fix(callAPIMethod): bug ff & safari#26
Conversation
2 similar comments
| return fetch(url, {...defaults.fetchOptions, ...fetchOptions, ...options}) | ||
| .then( result => { | ||
| const promiseCallback = result.body ? result[method]() : new Promise(resolve => resolve(result.body)); | ||
| const promiseCallback = result[method](); |
There was a problem hiding this comment.
@ya-woodcutter according to https://developer.mozilla.org/en-US/docs/Web/API/Response
Response implements Body. I think the issue is with isomorphic-fetch not being really isomorphic and using node-fetch underneath.
Did you try using Response.blob() instead?
const promiseCallback = result[result.body ? method : 'blob']();There was a problem hiding this comment.
I think the issue is with isomorphic-fetch not being really isomorphic...
Isomorphic-fetch implements the minimal functionality of fetch.
Did you try using Response.blob() instead?
I didn't try to do it. But I think that the transform data from Blob to the right data type will be problematic. It requires additional conditions.
I'll try to do something in this way.
Now:
|
|
@ya-woodcutter Sorry I've fucked up your pr |
|
@TimeRaider ? emm... it's ok :) |
094cbda to
56f86c9
Compare
56f86c9 to
f6c360a
Compare
2 similar comments
d9e87b8 to
ec4e3af
Compare
1 similar comment
| }) | ||
| .then( response => response[method]() | ||
| .catch( () => { | ||
| if (!response.ok) { |
ff & safari (isomorphic-fetch) doesn't support response.body