From da54921025758e6b234caa7fc3689e173e8fbbef Mon Sep 17 00:00:00 2001 From: cwmore <124852055+cwmore@users.noreply.github.com> Date: Tue, 13 Aug 2024 19:30:16 +0800 Subject: [PATCH] fix: Linkis-Gateway can not work with DELETE request without request (#5154) body (#1015) Co-authored-by: west <754515661@qq.com> --- .../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 e1b4bf430e..54a9965640 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 @@ -46,6 +46,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")