mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-01 03:28:59 +08:00
fix(接口测试): Mock后置脚本增加高危指令过滤
Mock后置脚本增加高危指令过滤
This commit is contained in:
parent
38d6de495b
commit
886b96351b
@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONValidator;
|
||||
import io.metersphere.api.dto.mock.ApiDefinitionResponseDTO;
|
||||
import io.metersphere.api.dto.mock.MockConfigRequestParams;
|
||||
import io.metersphere.api.dto.mock.RequestMockParams;
|
||||
import io.metersphere.api.dto.shell.filter.ScriptFilter;
|
||||
import io.metersphere.api.mock.dto.MockParamConditionEnum;
|
||||
import io.metersphere.commons.exception.MSException;
|
||||
import io.metersphere.commons.json.JSONSchemaGenerator;
|
||||
@ -281,6 +282,7 @@ public class MockApiUtils {
|
||||
LogUtil.error(e);
|
||||
}
|
||||
}
|
||||
ScriptFilter.verify(scriptLanguage, "Mock后置脚本", script);
|
||||
scriptEngine = scriptEngineUtils.getBaseScriptEngine(projectId, scriptLanguage, url, headerMap, requestMockParams);
|
||||
if (StringUtils.isNotEmpty(script) && scriptEngine != null) {
|
||||
scriptEngineUtils.runScript(scriptEngine, script);
|
||||
|
Loading…
Reference in New Issue
Block a user