extracted server id validation
This commit is contained in:
parent
807c44f057
commit
aae61f9451
15 changed files with 83 additions and 388 deletions
|
@ -3,15 +3,8 @@ const mozlog = require('../log');
|
|||
const log = mozlog('send.download');
|
||||
const crypto = require('crypto');
|
||||
|
||||
function validateID(route_id) {
|
||||
return route_id.match(/^[0-9a-fA-F]{10}$/) !== null;
|
||||
}
|
||||
|
||||
module.exports = async function(req, res) {
|
||||
const id = req.params.id;
|
||||
if (!validateID(id)) {
|
||||
return res.sendStatus(404);
|
||||
}
|
||||
|
||||
try {
|
||||
const auth = req.header('Authorization').split(' ')[1];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue