Skip to content

Commit b748f39

Browse files
authored
fix: let domain name pattern comply with TLD standard
1 parent 903be33 commit b748f39

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

src/common/constant.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ export const SUBNETS_PATTERN = 'subnet-[a-f0-9]+,(subnet-[a-f0-9]+,?)+';
195195
export const SECURITY_GROUP_PATTERN = 'sg-[a-f0-9]+';
196196
export const MUTIL_SECURITY_GROUP_PATTERN = `${SECURITY_GROUP_PATTERN}(,${SECURITY_GROUP_PATTERN})*`;
197197
export const DOMAIN_NAME_PATTERN =
198-
'[a-z0-9A-Z#$&@_%~\\*\\.\\-]+\\.[a-zA-Z0-9]{2,6}';
198+
'[a-z0-9A-Z#$&@_%~\\*\\.\\-]+\\.[a-zA-Z]{2,63}';
199199
export const IP_PATTERN =
200200
'((2(5[0-5]|[0-4]\\d))|[0-1]?\\d{1,2})(\\.((2(5[0-5]|[0-4]\\d))|[0-1]?\\d{1,2})){3}';
201201
export const HOST_ZONE_ID_PATTERN = '^Z[A-Z0-9]+$';

src/control-plane/backend/lambda/api/test/api/utils.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ describe('Utils test', () => {
133133
it('Domain Name valid', async () => {
134134
const validValues = [
135135
'fake.example.com',
136+
'test.immobilien',
136137
'example.com',
137138
];
138139

test/ingestion-server/server/ingestion-server-stack.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ test('domainName pattern', () => {
149149
const validValues = [
150150
'abc.com',
151151
'test.abc.com',
152+
'example.services',
153+
'test.example.graphics',
154+
'123.test.clickstream.management',
152155
'123.test.abc.com',
153156
'a123#~&%.test-2.a_bc.com',
154157
];

0 commit comments

Comments
 (0)