mirror of
https://github.com/bitinflow/server.git
synced 2026-03-13 13:35:53 +00:00
Allow dash characters in subdomain.
Thank you @zackslash via https://github.com/localtunnel/server/pull/47 Rebased to latest master.
This commit is contained in:
@@ -81,7 +81,7 @@ module.exports = function(opt) {
|
||||
const req_id = parts[1];
|
||||
|
||||
// limit requested hostnames to 63 characters
|
||||
if (! /^[a-z0-9]{4,63}$/.test(req_id)) {
|
||||
if (! /^(?:[a-z0-9][a-z0-9\-]{4,63}[a-z0-9]|[a-z0-9]{4,63})$/.test(req_id)) {
|
||||
const msg = 'Invalid subdomain. Subdomains must be lowercase and between 4 and 63 alphanumeric characters.';
|
||||
ctx.status = 403;
|
||||
ctx.body = {
|
||||
|
||||
Reference in New Issue
Block a user