Skip to content

Commit 26605a3

Browse files
authored
[app-builder] remove URL format validation in the HTTP plugin. the URL format is relatively complex, so we keep flexibility. (#576)
1 parent 9675148 commit 26605a3

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

frontend/src/pages/httpTool/components/http-information.tsx

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -234,15 +234,6 @@ const InformationConfiguration = (props: any) => {
234234
if (type === 'prev') {
235235
setStepCurrent(1);
236236
} else {
237-
if (!validateUrl(formParams.url)) {
238-
form.setFields([
239-
{
240-
name: 'url',
241-
errors: [t('plsEnterValidUrl')],
242-
},
243-
]);
244-
return;
245-
}
246237
setLoading(true);
247238
let params = requestParam(confirmHttpInfo);
248239
createHttp(params)
@@ -258,17 +249,6 @@ const InformationConfiguration = (props: any) => {
258249
}
259250
};
260251

261-
// url校验
262-
const validateUrl = (value: any) => {
263-
let strRegex =
264-
/^((((?!-)[A-Za-z0-9-]{1,63}(?<!-)\.)+[A-Za-z]{2,6})|(((2[0-4]\d|25[0-5])|[0-1]?\d{0,2})(\.((2[0-4]\d|25[0-5])|[0-1]?\d{0,2})){3}:((6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])|[0-5]?\d{0,4})))(\/[\w-?=&./{}]*)?$/;
265-
if (strRegex.test(value)) {
266-
return true;
267-
} else {
268-
return false;
269-
}
270-
};
271-
272252
useEffect(() => {
273253
if (httpInfo.schema?.name) {
274254
const HTTP = httpInfo.runnables?.HTTP;

0 commit comments

Comments
 (0)