mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 07:04:45 -04:00
Rename checkURiValid.js to checkURIValid.js
This commit is contained in:
parent
d79997808a
commit
0ef0e70579
1 changed files with 0 additions and 0 deletions
14
lib/web/middleware/checkURIValid.js
Normal file
14
lib/web/middleware/checkURIValid.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
'use strict'
|
||||
|
||||
const logger = require('../../logger')
|
||||
const response = require('../../response')
|
||||
|
||||
module.exports = function (req, res, next) {
|
||||
try {
|
||||
decodeURIComponent(req.path)
|
||||
} catch (err) {
|
||||
logger.error(err)
|
||||
return response.errorBadRequest(res)
|
||||
}
|
||||
next()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue