mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Relax hosts validation in Beats central management (#25376)
Current regexp was disallowing schema part of the URL (https://), so https hosts couldn't be configured. I opted for fully relaxing the reg exp here, as Beat will check it anyway, and report errors in case it's wrong.
This commit is contained in:
parent
03d1597903
commit
c757990be1
1 changed files with 2 additions and 18 deletions
|
@ -19,23 +19,8 @@ import {
|
|||
} from '../../inputs';
|
||||
|
||||
addValidationRule('isHosts', (form: FormData, values: FieldValue | string[]) => {
|
||||
if (values && values.length > 0 && values instanceof Array) {
|
||||
return values.reduce((pass: boolean, value: string) => {
|
||||
if (
|
||||
pass &&
|
||||
value.match(
|
||||
new RegExp(
|
||||
'^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]).)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$'
|
||||
)
|
||||
) !== null
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}, true);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
// TODO add more validation
|
||||
return true;
|
||||
});
|
||||
|
||||
addValidationRule('isString', (values: FormData, value: FieldValue) => {
|
||||
|
@ -54,7 +39,6 @@ addValidationRule('isPath', (values: FormData, value: FieldValue) => {
|
|||
|
||||
addValidationRule('isPaths', (values: FormData, value: FieldValue) => {
|
||||
// TODO add more validation
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue