fix(fn): don't leak error details back to the caller
This commit is contained in:
Родитель
7452684334
Коммит
274c2761cf
2
index.js
2
index.js
|
@ -61,7 +61,7 @@ async function main (data) {
|
|||
} catch(error) {
|
||||
return {
|
||||
statusCode: 500,
|
||||
body: error.stack,
|
||||
body: 'Internal Server Error',
|
||||
isBase64Encoded: false
|
||||
}
|
||||
}
|
||||
|
|
9
test.js
9
test.js
|
@ -482,10 +482,11 @@ suite('fxa-sendgrid-event-proxy:', () => {
|
|||
})
|
||||
|
||||
test('result is correct', () => {
|
||||
return promise.then(result => {
|
||||
assert.equal(result.statusCode, 500)
|
||||
assert.equal(result.body.indexOf('Error'), 0)
|
||||
})
|
||||
return promise.then(result => assert.deepEqual(result, {
|
||||
statusCode: 500,
|
||||
body: 'Internal Server Error',
|
||||
isBase64Encoded: false
|
||||
}))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Загрузка…
Ссылка в новой задаче