fix(接口测试): 修复场景里用接口上传的文件名乱码的缺陷
--bug=1010904 --user=王孝刚 【接口测试】场景里,用接口上传的文件名乱码,页面上传的就正常 https://www.tapd.cn/55049933/s/1117505
This commit is contained in:
parent
5b1f2e80da
commit
d34be48e4c
|
@ -156,7 +156,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.metersphere</groupId>
|
<groupId>io.metersphere</groupId>
|
||||||
<artifactId>ms-jmeter-core</artifactId>
|
<artifactId>ms-jmeter-core</artifactId>
|
||||||
<version>1.1.0</version>
|
<version>1.1.2</version>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<artifactId>netty</artifactId>
|
<artifactId>netty</artifactId>
|
||||||
|
|
|
@ -190,6 +190,11 @@ public class MsHTTPSamplerProxy extends MsTestElement {
|
||||||
List<KeyValue> bodyParams = this.body.getBodyParams(sampler, this.getId());
|
List<KeyValue> bodyParams = this.body.getBodyParams(sampler, this.getId());
|
||||||
if (StringUtils.isNotEmpty(this.body.getType()) && "Form Data".equals(this.body.getType())) {
|
if (StringUtils.isNotEmpty(this.body.getType()) && "Form Data".equals(this.body.getType())) {
|
||||||
sampler.setDoMultipart(true);
|
sampler.setDoMultipart(true);
|
||||||
|
this.body.getKvs().forEach(files -> {
|
||||||
|
if (StringUtils.isNotEmpty(files.getName()) && "file".equals(files.getType()) && CollectionUtils.isNotEmpty(files.getFiles())) {
|
||||||
|
sampler.setDoBrowserCompatibleMultipart(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (CollectionUtils.isNotEmpty(bodyParams)) {
|
if (CollectionUtils.isNotEmpty(bodyParams)) {
|
||||||
Arguments arguments = httpArguments(bodyParams);
|
Arguments arguments = httpArguments(bodyParams);
|
||||||
|
|
Loading…
Reference in New Issue