Permalink
Browse files

Merge pull request #15 from intesso/master

uploads json format has changed
  • Loading branch information...
2 parents 5add61f + 94d3081 commit 815f05097d3e279700a1a4a2ecb691646299c427 @aguidrevitch committed Feb 7, 2013
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/filehandler.js
View
@@ -8,14 +8,16 @@ module.exports = function (middleware, options) {
var UploadHandler = require('./uploadhandler')(options);
var handler = new UploadHandler(req, res, function (result, redirect) {
if (redirect) {
- res.redirect(redirect.replace(/%s/, encodeURIComponent(JSON.stringify(result))));
+ files = {files: result};
+ res.redirect(redirect.replace(/%s/, encodeURIComponent(JSON.stringify(files))));
} else {
res.set({
'Content-Type': (req.headers.accept || '').indexOf('application/json') !== -1
? 'application/json'
: 'text/plain'
});
- res.json(200, result);
+ files = {files: result};
+ res.json(200, files);
}
});

0 comments on commit 815f050

Please sign in to comment.