diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMapper.xml b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMapper.xml index c57fdec10f..ee270b240c 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMapper.xml +++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMapper.xml @@ -504,6 +504,7 @@ api_definition.num like concat('%', #{request.condition.keyword},'%') or api_definition.name like concat('%', #{request.condition.keyword},'%') or api_definition.tags like concat('%', #{request.condition.keyword},'%') + or api_definition.path like concat('%', #{request.condition.keyword},'%') ) diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/HarParserApiDefinition.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/HarParserApiDefinition.java index 06cd9166ee..37bfc01b96 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/HarParserApiDefinition.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/HarParserApiDefinition.java @@ -363,8 +363,9 @@ public class HarParserApiDefinition extends HttpApiDefinitionImportAbstractParse if (StringUtils.equalsIgnoreCase("GET", requestBody.method) || requestBody.postData == null) { return; } - String bodyType = Body.BodyType.NONE.name(); + String bodyType = content.mimeType; if (StringUtils.isEmpty(bodyType)) { + bodyType = Body.BodyType.RAW.name(); body.setRawBody(new RawBody() {{ this.setValue(content.text); }}); diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/ms/http/HeaderManagerConverter.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/ms/http/HeaderManagerConverter.java index 0b13891867..26390e51ba 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/parser/ms/http/HeaderManagerConverter.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/ms/http/HeaderManagerConverter.java @@ -4,6 +4,7 @@ import io.metersphere.api.dto.request.http.MsHTTPElement; import io.metersphere.api.dto.request.http.MsHeader; import io.metersphere.plugin.api.spi.AbstractMsElementConverter; import io.metersphere.plugin.api.spi.AbstractMsTestElement; +import jodd.util.StringUtil; import org.apache.jmeter.protocol.http.control.HeaderManager; import org.apache.jmeter.testelement.property.CollectionProperty; import org.apache.jmeter.testelement.property.JMeterProperty; @@ -23,10 +24,18 @@ public class HeaderManagerConverter extends AbstractMsElementConverter