Skip to content

Commit 8075e89

Browse files
committed
Merge pull request #126 from deiu/master
Fixed weird [object Object] responses
2 parents 7b5fe50 + f35f89f commit 8075e89

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎index.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ function routes () {
159159
getRawBody(req,
160160
{
161161
length: req.headers['content-length'],
162-
limit: '1mb',
163162
encoding: 'utf-8' // typer.parse(req.headers['content-type']).parameters.charset
164163
},
165164
function(err, string) {

‎lib/handlers/error.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ function errorPageHandler(err, req, res, next) {
99
// If noErrorPages is set,
1010
// then use built-in express default error handler
1111
if (ldp.noErrorPages) {
12-
return next(err);
12+
return res
13+
.status(err.status)
14+
.send(err.message);
1315
}
1416

1517
// Check if error page exists

‎lib/handlers/get.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ function aclAllow(match, req, res, callback) {
178178
var relativePath = '/' + path.relative(ldp.root, match);
179179
res.locals.path = relativePath;
180180
acl.allow("Read", req, res, function(err) {
181-
callback(!err);
181+
callback(err);
182182
});
183183
}
184184

@@ -217,7 +217,7 @@ function parseLinkedData(req, res, next) {
217217
$rdf.serialize(undefined, resourceGraph, null, accept, function(err, result) {
218218
if (result === undefined || err) {
219219
debug("GET/HEAD -- Serialization error: " + err);
220-
var serializeErr = new Error();
220+
var serializeErr = {};
221221
serializeErr.status = 500;
222222
serializeErr.message = err.message;
223223
return next(serializeErr);

0 commit comments

Comments
 (0)