replace dns validation regex
Signed-off-by: pitwegner <pit.wegner@student.hpi.de>
This commit is contained in:
@@ -155,6 +155,7 @@ describe('CommonValidatorFunctions', () => {
|
||||
['-a-b', false],
|
||||
['a-b-', false],
|
||||
['a--b', false],
|
||||
['xn--c6h', true],
|
||||
['a_b', false],
|
||||
[`${'a'.repeat(63)}`, true],
|
||||
[`${'a'.repeat(64)}`, false],
|
||||
|
||||
@@ -91,7 +91,7 @@ export class CommonValidatorFunctions {
|
||||
typeof value === 'string' &&
|
||||
value.length >= 1 &&
|
||||
value.length <= 63 &&
|
||||
/^[a-z0-9]+(\-[a-z0-9]+)*$/.test(value)
|
||||
/^((?!\-))(xn\-\-)?[a-z0-9\-]+[a-z0-9]$/.test(value)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user