Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NIP-96 uploads fail even when successful #273

Open
twenty-eighty opened this issue Sep 29, 2024 · 0 comments
Open

NIP-96 uploads fail even when successful #273

twenty-eighty opened this issue Sep 29, 2024 · 0 comments

Comments

@twenty-eighty
Copy link

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}`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant