kimmelsg/cj-upload

UploadRequest resolves with error for 2xx status codes other then 200 and 201

Closed this issue · 2 comments

First things first

Thank you for sharing this great project. Really handy!

Minor Issue

If e.g. I upload a file to S3, it returns a 204 which is not an error. Nevertheless UploadRequest will resolve to:

{
  error: true,
  response: "",
  status: 204
}

Also there are a lot more 2xx success statuses (https://httpstatuses.com/). I think you shouldn't set error: true for them either...

Haha yes that was a really bad mistake on my part. Will fix this today.

This should do it. Error if status is less than 200, or greater than / equal to 300 157dc9a