fix(接口测试): 修复场景里用接口上传的文件名乱码的缺陷

--bug=1010904 --user=王孝刚 【接口测试】场景里,用接口上传的文件名乱码,页面上传的就正常
https://www.tapd.cn/55049933/s/1117505
This commit is contained in:
wxg0103 2022-03-14 18:55:14 +08:00 committed by fit2-zhao
parent 5b1f2e80da
commit d34be48e4c
2 changed files with 6 additions and 1 deletions

View File

@ -156,7 +156,7 @@
<dependency>
<groupId>io.metersphere</groupId>
<artifactId>ms-jmeter-core</artifactId>
<version>1.1.0</version>
<version>1.1.2</version>
<exclusions>
<exclusion>
<artifactId>netty</artifactId>

View File

@ -190,6 +190,11 @@ public class MsHTTPSamplerProxy extends MsTestElement {
List<KeyValue> bodyParams = this.body.getBodyParams(sampler, this.getId());
if (StringUtils.isNotEmpty(this.body.getType()) && "Form Data".equals(this.body.getType())) {
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)) {
Arguments arguments = httpArguments(bodyParams);