mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-21 09:16:30 -05:00
Fix express deprecation warning
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
bed9835d36
commit
63f33f1737
1 changed files with 6 additions and 6 deletions
|
@ -4,7 +4,7 @@ module.exports = {
|
|||
errorForbidden: function (res) {
|
||||
const { req } = res
|
||||
if (req.user) {
|
||||
responseError(res, '403', 'Forbidden', 'oh no.')
|
||||
responseError(res, 403, 'Forbidden', 'oh no.')
|
||||
} else {
|
||||
if (!req.session) req.session = {}
|
||||
if (req.originalUrl !== '/403') {
|
||||
|
@ -15,19 +15,19 @@ module.exports = {
|
|||
}
|
||||
},
|
||||
errorNotFound: function (res) {
|
||||
responseError(res, '404', 'Not Found', 'oops.')
|
||||
responseError(res, 404, 'Not Found', 'oops.')
|
||||
},
|
||||
errorBadRequest: function (res) {
|
||||
responseError(res, '400', 'Bad Request', 'something not right.')
|
||||
responseError(res, 400, 'Bad Request', 'something not right.')
|
||||
},
|
||||
errorConflict: function (res) {
|
||||
responseError(res, '409', 'Conflict', 'This note already exists.')
|
||||
responseError(res, 409, 'Conflict', 'This note already exists.')
|
||||
},
|
||||
errorTooLong: function (res) {
|
||||
responseError(res, '413', 'Payload Too Large', 'Shorten your note!')
|
||||
responseError(res, 413, 'Payload Too Large', 'Shorten your note!')
|
||||
},
|
||||
errorInternalError: function (res) {
|
||||
responseError(res, '500', 'Internal Error', 'wtf.')
|
||||
responseError(res, 500, 'Internal Error', 'wtf.')
|
||||
},
|
||||
errorServiceUnavailable: function (res) {
|
||||
res.status(503).send('I\'m busy right now, try again later.')
|
||||
|
|
Loading…
Reference in a new issue