Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix. image path is filename, not id

  • Loading branch information...
commit 04b31e46130ee128e0b7a2c21baa23218037b0de 1 parent 3aa604d
@nikhilm authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 server.js
View
8 server.js
@@ -28,7 +28,7 @@ function getOut(code, error, resp) {
}));
}
-function reply(faces, id, resp) {
+function reply(faces, id, path, resp) {
if( typeof(faces) == 'string' ) {
getOut(415, faces == 'No Error' ? 'Unknown error' : faces, resp);
return;
@@ -38,7 +38,7 @@ function reply(faces, id, resp) {
status: 'success',
faces: faces,
id: id,
- image_url: URL + '/image/'+id,
+ image_url: URL + '/image/'+require('path').basename(path),
share_url: URL + '/view/'+id
};
resp.writeHead(200, { 'Content-Type': 'application/json' });
@@ -96,7 +96,7 @@ function handleUrl(request, response) {
// because we can always reply with
// the list of faces right now even
// if we can't cache it
- reply(face.faces(stream.path), id, response);
+ reply(face.faces(stream.path), id, stream.path, response);
});
});
stream.end();
@@ -122,7 +122,7 @@ function handleFile(request, response) {
// because we can always reply with
// the list of faces right now even
// if we can't cache it
- reply(face.faces(stream.path), id, response);
+ reply(face.faces(stream.path), id, stream.path, response);
});
});
stream.end();
Please sign in to comment.
Something went wrong with that request. Please try again.