jimmynicol / image-resizer

On-the-fly image resizing using Node.js and GraphicsMagick. Heroku Ready!
MIT License
340 stars 105 forks source link

Request with malformed paths result in a crash #58

Closed jackmurphy closed 9 years ago

jackmurphy commented 9 years ago

I made a request for an image on s3 with the following url. Note the missing hyphen from the path. http://example.com/h200w200/media/doodle/image.jpg

Which causes sharp.resize to crash with a Error: Invalid height (1 to 16383) error.

Here's the full stacktrace and contents of my platform.js fle

I would have expected a 400 response. Do you think you can add some validation?

Also, it doesn't seem like errors here should crash the whole server. Is there some configuration setting I'm missing? Currently it's running in production mode.

Node is new to me but I'm willing to pitch in if needed. Just let me know how you think it ought to be handled.

wjordan commented 9 years ago

It looks like the Invalid height issue was fixed a couple weeks ago by #54, but a new version including the fix has not been pushed to NPM yet.

jimmynicol commented 9 years ago

Thats right, sorry. I have been trying to get through the issues and push a release with them all. Hopefully tonight or tomorrow. Also @wjordan thanks for the PR's will sort them at the same time.

saintberry commented 9 years ago

@jimmynicol any update on this patch?

jimmynicol commented 9 years ago

Sorry for the delay, this is in v1.2.0.