mirror of
https://github.com/bitinflow/server.git
synced 2026-03-13 13:35:53 +00:00
disallow uppercase domains, with test
This commit is contained in:
@@ -197,8 +197,8 @@ module.exports = function(opt) {
|
||||
var req_id = req.param('req_id');
|
||||
|
||||
// limit requested hostnames to 20 characters
|
||||
if (! /^[A-Za-z0-9]{4,20}$/.test(req_id)) {
|
||||
var err = new Error('Invalid subdomain. Subdomains must be between 4 and 20 alphanumeric characters.');
|
||||
if (! /^[a-z0-9]{4,20}$/.test(req_id)) {
|
||||
var err = new Error('Invalid subdomain. Subdomains must be lowercase and between 4 and 20 alphanumeric characters.');
|
||||
err.statusCode = 403;
|
||||
return next(err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user