nostrbuild / nostr.build

FOSS version of nostr.build
https://nostr.build
MIT License
58 stars 10 forks source link

When Upload CORS 400 #4

Closed haorendashu closed 1 year ago

haorendashu commented 1 year ago

I try to upload image throw cors, but api return 400.

I think you should add the headers Access-Control-Allow-Headers and Access-Control-Allow-Methods .

Such as:

Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Content-Length
Access-Control-Max-Age: 86400

Due to when i send post request it return 400 and isn't CORS error, i believe that there must be some info haven't bean send to server.

This is the option request info:

uploadoption

This is the post request and it return 400:

upload400
fishcakeday commented 1 year ago

This should be fixed now. Please try now and also provide further information if you experience any other errors. It would be good to see what you are submitting and what error the server returns in return.

fishcakeday commented 1 year ago

22f060a1663fd297a71eb84ac302f68634d0ed7a should have fixed it