galenmaly/lighterpack

imgur upload failes for me

Closed this issue · 6 comments

Are there any other people?

"app.ddb859ffe7fe6f7eaa47.js:2 POST https://lighterpack.com/imageUpload 500 (Internal Server Error)"

i sent an email a few days ago, no reply.

The imgur API is returning a 500, but https://status.imgur.com/ claims there aren't any problems.

I was hoping they'd get it sorted on their end, but it looks like I might need to look into a new image hosting solution. I'll have time to look into it later this week.

There's a chance that their API simply changed and we'll just need to change the format of data we're sending, but you'd hope they would have sent a 400 instead of 500 in that case.

Are there any other people?

Same here

I know basically nothing, but when I compare the imgur docs to the code, they look different.

Docs: https://apidocs.imgur.com/#c85c9dfc-7487-4de2-9ecd-66f727cf3139
Code:

const temp = { uri: 'https://api.imgur.com/3/image', headers: { Authorization: `Client-ID ${config.get('imgurClientID')}` } };

From the docs I'd expect something closer to this:

const formData = {
  image: files.image,
  type: "file"
};
request.post({
    uri: 'https://api.imgur.com/3/image',
    headers: { Authorization: `Client-ID ${config.get('imgurClientID')}` },
    formData: formData,
    json: true
}, (e, r, body) => {
  // ...
});

... but like I said, I know basically nothing and maybe I'm misinterpreting the docs.


I'm always on the other side of the API equation, and at some point if a API client sends me data that is so far from what I expect, it's going to end up as a 500. Input validation can only get you so far. Not sure whether that's what is happening here.

This should be fixed. It looks like imgur removed support for the way we had been uploading images for the last 10 years.

32ab8ba?diff=split&w=1