Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

don't do request for image if options are invalid

  • Loading branch information...
commit 16ec3222ae364c440a42500fbcfa5e520c051f05 1 parent 0f62dc2
@kcivey kcivey authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 server.js
View
5 server.js
@@ -21,12 +21,13 @@ app.get(/^(\/.+)\.([^.\/]+)(\.jpe?g)$/i, function (req, res) {
var convertOptions = getConvertOptions(req.params[1]),
relativePath = req.params[0] + req.params[2],
source = basePath + relativePath,
- r = request(source),
- times = {start: Date.now()};
+ times = {start: Date.now()},
+ r;
if (!convertOptions) {
res.send(400);
return;
}
+ r = request(source);
r.on('response', function (remoteRes) {
var maxAge, m, rawFile, convertedFile, stream;
if (remoteRes.statusCode === 200) {
Please sign in to comment.
Something went wrong with that request. Please try again.