From c191e40a145b0028c4cc795fe628f8f7067f9878 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Thu, 16 May 2024 17:01:56 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96mock=E8=BF=94=E5=9B=9E=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metersphere/api/service/mockserver/MockServerService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/mockserver/MockServerService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/mockserver/MockServerService.java index a2e5b24509..ce25438d98 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/mockserver/MockServerService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/mockserver/MockServerService.java @@ -247,7 +247,8 @@ public class MockServerService { case "JSON" -> responseEntity(responseCode, responseBody.getJsonBody().getJsonWithSchema(), headers); case "XML" -> responseEntity(responseCode, responseBody.getXmlBody().getValue(), headers); case "RAW" -> responseEntity(responseCode, responseBody.getRawBody().getValue(), headers); - default -> handleBinaryBody(responseBody, projectId, resourceId, isMock); + case "BINARY" -> handleBinaryBody(responseBody, projectId, resourceId, isMock); + default -> responseEntity(responseCode, StringUtils.EMPTY, headers); }; }