Added cors

Signed-off-by: walamana <joniogerg@gmail.com>
This commit is contained in:
2018-08-23 15:04:49 +02:00
parent 9195e7b9f6
commit 901f838551
168 changed files with 28845 additions and 214 deletions

View File

@@ -89,6 +89,7 @@ function json (options) {
return JSON.parse(body, reviver)
} catch (e) {
throw normalizeJsonSyntaxError(e, {
message: e.message,
stack: e.stack
})
}
@@ -208,12 +209,9 @@ function normalizeJsonSyntaxError (error, obj) {
}
}
var props = Object.keys(obj)
for (var j = 0; j < props.length; j++) {
var prop = props[j]
error[prop] = obj[prop]
}
// replace stack before message for Node.js 0.10 and below
error.stack = obj.stack.replace(error.message, obj.message)
error.message = obj.message
return error
}