You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by li...@apache.org on 2022/05/06 07:08:36 UTC
[dolphinscheduler] branch dev updated: [Fix]Added request header validation (#9915)
This is an automated email from the ASF dual-hosted git repository.
liudongkai pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new c9bba819bd [Fix]Added request header validation (#9915)
c9bba819bd is described below
commit c9bba819bd73721c098cfa0352bbb47c1265a5d2
Author: labbomb <73...@qq.com>
AuthorDate: Fri May 6 00:08:31 2022 -0700
[Fix]Added request header validation (#9915)
---
dolphinscheduler-ui/src/locales/modules/en_US.ts | 1 +
dolphinscheduler-ui/src/locales/modules/zh_CN.ts | 1 +
.../src/views/projects/task/components/node/fields/use-http.ts | 3 +++
3 files changed, 5 insertions(+)
diff --git a/dolphinscheduler-ui/src/locales/modules/en_US.ts b/dolphinscheduler-ui/src/locales/modules/en_US.ts
index f61eb95d84..512fe74ae6 100644
--- a/dolphinscheduler-ui/src/locales/modules/en_US.ts
+++ b/dolphinscheduler-ui/src/locales/modules/en_US.ts
@@ -725,6 +725,7 @@ const project = {
task_manager_number_tips: 'Please enter TaskManager number',
http_url: 'Http Url',
http_url_tips: 'Please Enter Http Url',
+ http_url_validator: 'The request address must contain HTTP or HTTPS',
http_method: 'Http Method',
http_parameters: 'Http Parameters',
http_check_condition: 'Http Check Condition',
diff --git a/dolphinscheduler-ui/src/locales/modules/zh_CN.ts b/dolphinscheduler-ui/src/locales/modules/zh_CN.ts
index 260c7e7dbe..7880ff3b50 100644
--- a/dolphinscheduler-ui/src/locales/modules/zh_CN.ts
+++ b/dolphinscheduler-ui/src/locales/modules/zh_CN.ts
@@ -715,6 +715,7 @@ const project = {
task_manager_number_tips: '请输入TaskManager数量',
http_url: '请求地址',
http_url_tips: '请填写请求地址(必填)',
+ http_url_validator: '请求地址需包含http或者https',
http_method: '请求类型',
http_parameters: '请求参数',
http_check_condition: '校验条件',
diff --git a/dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-http.ts b/dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-http.ts
index 4f3ede7262..a8ff5ebea7 100644
--- a/dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-http.ts
+++ b/dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-http.ts
@@ -55,6 +55,9 @@ export function useHttp(model: { [field: string]: any }): IJsonItem[] {
if (!value) {
return new Error(t('project.node.http_url_tips'))
}
+ if (value.search(new RegExp('http[s]{0,1}:\/\/([\w.]+\/?)\S*', 'i'))) {
+ return new Error(t('project.node.http_url_validator'))
+ }
}
}
},