Closed chasen-bettinger closed 1 year ago
Hi, thanks for taking the time to look at the code and make a PR, but I think this is good use case where people could write small custom requestFunctions, for your example:
function requestFunction (url, fetchinit) {
const opt = { ...fetchinit };
delete opt.credentials;
fetch(url, opt);
}
const res = await translate('cat', {from: 'en', to: 'es', forceBatch: false, requestFunction});
Closing as inactive, feel free to comment if anyone wants it re-opened
Hello! Thank you for the great library. I was attempting to use this in Cloudfare workers and it appears that for some unknown reason, they disallow the use of the
credentials
field in HTTP requests. This change enables the user to have more control over what request options are being used so that in the case of Cloudfare workers, thecredentials
field can be omitted.