Uploading files with Nip96.upload fail because of too strict status code handling. (tested with different servers)
The error:
Error uploading file: Error: Failed to upload file to https://files.sovbit.host/api/v2/media
at Nip96.upload (index.mjs:7954:13)
at async Object.onUpload (Editor.js:122:56)
The answer of the server:
Request URL: https://files.sovbit.host/api/v2/media
Request Method: POST
Status Code: 202 Accepted
The code that checks for the status code:
if (res.status !== 200)
throw new Error(`Failed to upload file to ${url}`);
Uploading files with
Nip96.upload
fail because of too strict status code handling. (tested with different servers)The error:
The answer of the server:
The code that checks for the status code: