dnanexus / dx-javascript-toolkit

DNAnexus Javascript Libraries
Apache License 2.0
13 stars 1 forks source link

403 forbidden error in uploading-files-basic example #2

Open marpiech opened 7 years ago

marpiech commented 7 years ago

While trying to upload small text file, in uploading-files-basic example, it fails with 403 error.

How to reproduce:

  1. Clone project
  2. Set projectid and authtoken inside index.html in uploading-files-basic
  3. Open index.html in uploading-files-basic
  4. Try to upload small file

Additional info: After pressing upload button, initial requests are ok:

  1. https://api.dnanexus.com/system/findDataObjects
  2. https://api.dnanexus.com/file/new This request fails:
  3. https://api.dnanexus.com/file-????/upload However, 403 is reported by this address: https://dnanexus-platform-upload-prod.s3.amazonaws.com/filev2/e66b/file/ope
cygnil commented 7 years ago

Thanks for reporting this issue! We'll take a look and check in a fix soon if we find anything.

JoeSachmo commented 7 years ago

Thanks again for reporting this issue!

It seems like this 403 Forbidden response is due to an invalid CORS request. If you try to open index.html locally, you will likely send an Origin: null header to our back end which is rejected due to security concerns. If you try to load index.html from the web instead, you should be able to execute the uploading-files-basic example without this error.