Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 Update resolver.ts - Add null verification to .get("Content-Type")
The line response.headers.get("Content-Type").split(";")[0] is missing a ? before the call to "split". The Content-Type header may not be filled if the response has no body (e.g., in responses that only return a status code). When that happens, you get the following error: TypeError: Cannot read properties of null (reading 'split') at file://.../node_modules/wretch/dist/resolver.js:44:88 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at <your app's call stack> This verification handles this case.
- Loading branch information