Skip to content

Commit

Permalink
[api] Fix the regex for hostnames
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Hassine committed Apr 7, 2021
1 parent a79a3ba commit 045096a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion opencti-platform/opencti-graphql/src/utils/syntax.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const checkObservableSyntax = (observableType, observableData) => {
}
break;
case C.ENTITY_X_OPENCTI_HOSTNAME:
const hostnameChecker = /^(([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])$/;
const hostnameChecker = /^(([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])$/;
if (!hostnameChecker.test(observableData.value)) return 'Valid hostname';
break;
case C.ENTITY_EMAIL_ADDR:
Expand Down

0 comments on commit 045096a

Please sign in to comment.