Merge pull request +9703 from c9/fix-restore-screen

white list error keys
pull/199/head
Matthijs van Henten 2015-10-05 16:55:12 +02:00
commit c01d232128
1 zmienionych plików z 11 dodań i 2 usunięć

Wyświetl plik

@ -115,11 +115,20 @@ function plugin(options, imports, register) {
if (/json/.test(accept)) {
var error = {
code: statusCode,
message: err.message,
hostname: options.hostname,
scope: options.scope,
stack: stack,
stack: stack
};
var allowedErrorKeys = [
"message", "projectState", "premium", "retryIn", "progress",
"oldHost", "blocked"
];
allowedErrorKeys.forEach(function(key) {
if (err.hasOwnProperty(key))
error[key] = err[key];
});
try {
JSON.stringify(error);