fix(接口测试): Mock后置脚本增加高危指令过滤

Mock后置脚本增加高危指令过滤
This commit is contained in:
song-tianyang 2022-09-15 13:48:52 +08:00 committed by f2c-ci-robot[bot]
parent 38d6de495b
commit 886b96351b

View File

@ -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);