mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-25 00:48:45 +00:00
chore(vulnerability): Inefficient Regular Expression - Potential high time complexity leading to ReDoS (#10315)
This commit is contained in:
parent
0b09181bc1
commit
1fafc6c56c
@ -132,7 +132,7 @@ export const getExecutionRequestStatusDisplayColor = (status: string) => {
|
||||
export const validateURL = (fieldName: string) => {
|
||||
return {
|
||||
validator(_, value) {
|
||||
const URLPattern = new RegExp(/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w.-]+)+[\w\-._~:/?#[\]@!$&'()*+,;=.]+$/);
|
||||
const URLPattern = new RegExp(/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[a-zA-Z0-9.-]{2,})+[\w\-._~:/?#[\]@!$&'()*+,;=.]+$/);
|
||||
const isURLValid = URLPattern.test(value);
|
||||
if (!value || isURLValid) {
|
||||
return Promise.resolve();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user