mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-13 06:34:39 -04:00
Minor refactoring of freeURL condition check
Signed-off-by: Nicolas Dietrich <nidi@mailbox.org>
This commit is contained in:
parent
ea52746104
commit
3331c0947c
1 changed files with 6 additions and 4 deletions
|
@ -51,10 +51,12 @@ exports.newNote = function (req, res, body) {
|
|||
} else if (!config.allowAnonymous) {
|
||||
return errors.errorForbidden(res)
|
||||
}
|
||||
if (config.allowFreeURL && noteId && !config.forbiddenNoteIDs.includes(noteId)) {
|
||||
req.alias = noteId
|
||||
} else if (noteId) {
|
||||
return req.method === 'POST' ? errors.errorForbidden(res) : errors.errorNotFound(res)
|
||||
if (noteId) {
|
||||
if (config.allowFreeURL && !config.forbiddenNoteIDs.includes(noteId)) {
|
||||
req.alias = noteId
|
||||
} else {
|
||||
return req.method === 'POST' ? errors.errorForbidden(res) : errors.errorNotFound(res)
|
||||
}
|
||||
}
|
||||
models.Note.create({
|
||||
ownerId: owner,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue