Merge branch 'v1.2' of github.com:fit2cloudrd/metersphere-server into v1.2

This commit is contained in:
Captain.B 2020-09-01 10:08:31 +08:00
commit 7d156c4399
6 changed files with 16 additions and 3 deletions

View File

@ -47,4 +47,6 @@ public class HttpRequest implements Request {
private Long connectTimeout;
@JSONField(ordinal = 15)
private Long responseTimeout;
@JSONField(ordinal = 16)
private Boolean followRedirects;;
}

View File

@ -38,6 +38,7 @@
v-model="request.useEnvironment"
:active-text="$t('api_test.request.refer_to_environment')" @change="useEnvironmentChange">
</el-switch>
<el-checkbox class="follow-redirects-item" v-model="request.followRedirects">{{$t('api_test.request.follow_redirects')}}</el-checkbox>
</el-form-item>
<el-button :disabled="!request.enable || !scenario.enable || isReadOnly" class="debug-button" size="small" type="primary" @click="runDebug">{{ $t('api_test.request.debug') }}</el-button>
@ -221,4 +222,8 @@ export default {
color: #F56C6C;
}
.follow-redirects-item {
margin-left: 30px;
}
</style>

View File

@ -295,8 +295,10 @@ export class HTTPSamplerProxy extends DefaultTestElement {
if (options.responseTimeout) {
this.stringProp('HTTPSampler.response_timeout', options.responseTimeout);
}
if (options.followRedirects) {
this.boolProp('HTTPSampler.follow_redirects', options.followRedirects, true);
}
this.boolProp("HTTPSampler.follow_redirects", options.follow, true);
this.boolProp("HTTPSampler.use_keepalive", options.keepalive, true);
}
}

View File

@ -312,6 +312,7 @@ export class HttpRequest extends Request {
this.enable = true;
this.connectTimeout = 60*1000;
this.responseTimeout = undefined;
this.followRedirects = true;
this.set(options);
this.sets({parameters: KeyValue, headers: KeyValue}, options);
@ -749,6 +750,7 @@ class JMXHttpRequest {
}
this.connectTimeout = request.connectTimeout;
this.responseTimeout = request.responseTimeout;
this.followRedirects = request.followRedirects;
}
}
@ -867,11 +869,11 @@ class JMXGenerator {
}
}
this.addBeanShellProcessor(sampler, request);
this.addRequestExtractor(sampler, request);
this.addRequestAssertion(sampler, request);
this.addRequestExtractor(sampler, request);
this.addBeanShellProcessor(sampler, request);
threadGroup.put(sampler);
}

View File

@ -448,6 +448,7 @@ export default {
timeout_config: "Timeout Config",
connect_timeout: "Connect Timeout",
response_timeout: "Response Timeout",
follow_redirects: "Follow Redirects",
body_upload_limit_size: "The file size does not exceed 500 MB",
assertions: {
label: "Assertion",

View File

@ -449,6 +449,7 @@ export default {
timeout_config: "超时设置",
connect_timeout: "连接超时",
response_timeout: "响应超时",
follow_redirects: "跟隨重定向",
body_upload_limit_size: "上传文件大小不能超过 500 MB!",
assertions: {
label: "断言",