-
Notifications
You must be signed in to change notification settings - Fork 172
Open
Description
SDK you're using (please complete the following information):
- Version 10.0.0
Is your feature request related to a problem? Please describe.
Serverless platforms (specifically Cloudflare Workers/Pages) may not support some of all of the 'http' functions. In the CF case, they do not fully support the HTTPS handling. (They do support the fetch variation).
Describe the solution you'd like
Enable xero-node to set the axios adapter to the 'fetch' adapter (which is now built-in) at configuration time. It may be necessary to add an addiitonal optional parameter to XeroClient to set this value. Alternatively, the whole project may prefer to use fetch by default in v11.
Describe alternatives you've considered
- There does not appear to be a way to override the axios adapter without explicit code changes
- Axios detects 'http' because CF mocks it, but CF does not fully implement it. This means, the http adapter is chosen as the default, but later functions fail.
Additional context
Quick code validation:
- run the xero-node tests:
npm test(all pass) - Add this to line 6 of the XeroClient.ts file:
axios.defaults.adapter = 'fetch'; - Run tests again - 3 failures
Metadata
Metadata
Assignees
Labels
No labels
