Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
aiceflower committed Jan 10, 2025
1 parent 034a48d commit 554713b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1447,8 +1447,8 @@ public Message pythonUpload(
@RequestMapping(path = "/get-register-functions", method = RequestMethod.GET)
public Message getRegisterFunctions(HttpServletRequest req, @RequestParam("path") String path)
throws IOException {
// 使用正则校验path,防止命令注入漏洞
if (!path.matches("^[a-zA-Z0-9_.-/:]+$")) {
String pathPrefix = "file:///";
if (StringUtils.isEmpty(path) || !path.startsWith(pathPrefix)) {
return Message.error("path参数格式错误");
}
if (StringUtils.endsWithIgnoreCase(path, Constants.FILE_EXTENSION_PY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down Expand Up @@ -215,10 +215,10 @@
type="textarea"/>
</FormItem>
<FormItem :label="$t('message.linkis.udf.class')" prop="directory">
<Select
ref="directory"
<Select
ref="directory"
v-model="setting.directory" filterable
@on-query-change="queryChange"
@on-query-change="queryChange"
:remoteMethod="filterAdd" :disabled="model === 1">
<Option
v-for="(item) in directories"
Expand All @@ -229,7 +229,7 @@
</FormItem>
<FormItem :label="$t('message.linkis.udf.clusterName')">
<Select v-model="setting.clusterName" :disabled="model === 1">
<Option
<Option
label="all"
value="all" />
</Select>
Expand Down Expand Up @@ -324,7 +324,7 @@ export default {
directory: ''
},
isShareLoading: false,

registerFunctionEditable: true,
rules: {
name: [
Expand Down Expand Up @@ -699,7 +699,7 @@ export default {

async setNodePath(node) {
this.$set(this.setting, this.getTypes(), node.path);
if(this.model !== 1) {
if(this.model !== 1 && /^[\w\u4e00-\u9fa5:.\\/]*(py|scala)$/.test(node.path)) {
try {
this.registerFunctions = await this.getRegisterFunction(node.path);
if(this.registerFunctions.length !== 0) {
Expand All @@ -714,7 +714,7 @@ export default {
this.registerFunctionEditable = true;
}
}

},

getTypes() {
Expand Down Expand Up @@ -836,7 +836,7 @@ export default {
height: 100% !important;
}
}

.ivu-modal-content {
height: 100% !important;
}
Expand All @@ -845,4 +845,4 @@ export default {
}
}
}
</style>
</style>

0 comments on commit 554713b

Please sign in to comment.