From 7143f110cb15bfacf2fd4b6fc102392d51b7062d Mon Sep 17 00:00:00 2001 From: west <754515661@qq.com> Date: Thu, 8 Aug 2024 10:31:12 +0800 Subject: [PATCH] fix: Linkis-Gateway can not work with DELETE request without request body (#1015) --- .../apache/linkis/gateway/dss/parser/DSSGatewayParser.scala | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-server-support/src/main/scala/org/apache/linkis/gateway/dss/parser/DSSGatewayParser.scala b/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-server-support/src/main/scala/org/apache/linkis/gateway/dss/parser/DSSGatewayParser.scala index bdf8dfbe5f..2d2c3c992a 100644 --- a/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-server-support/src/main/scala/org/apache/linkis/gateway/dss/parser/DSSGatewayParser.scala +++ b/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-server-support/src/main/scala/org/apache/linkis/gateway/dss/parser/DSSGatewayParser.scala @@ -45,6 +45,11 @@ class DSSGatewayParser extends AbstractGatewayParser { val appConns = DSSGatewayConfiguration.DSS_URL_APPCONNS.getValue.split(",") override def shouldContainRequestBody(gatewayContext: GatewayContext): Boolean = { + val requestMethod = gatewayContext.getRequest.getMethod.toUpperCase(Locale.getDefault) + if ("DELETE".equals(requestMethod)) { + return false + } + var contentType = gatewayContext.getRequest.getHeaders.get("Content-Type") if (null == contentType) { contentType = gatewayContext.getRequest.getHeaders.get("content-type")