From 64c360e1cb47891afe62236840f214c7ef7dee68 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 30 Jun 2021 19:39:01 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-54573=20=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E9=A2=84=E8=A7=88=E6=8A=A5=E9=94=99400?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E5=A4=B4=E8=BF=87=E5=A4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/start/server/FineEmbedServerActivator.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java index 5fa8173d4..854d260bf 100644 --- a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java +++ b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java @@ -6,6 +6,7 @@ import com.fr.module.Activator; import com.fr.module.ModuleRole; import com.fr.stable.EncodeConstants; import com.fr.stable.ProductConstants; +import com.fr.stable.StringUtils; import com.fr.startup.FineWebApplicationInitializer; import com.fr.third.springframework.web.SpringServletContainerInitializer; import com.fr.third.springframework.web.context.support.AnnotationConfigWebApplicationContext; @@ -26,6 +27,8 @@ import java.util.Set; */ public class FineEmbedServerActivator extends Activator { + private static final String TOMCAT_MAX_HEADER_SIZE = "tomcat-maxHttpHeaderSize"; + private Tomcat tomcat; @Override @@ -68,6 +71,7 @@ public class FineEmbedServerActivator extends Activator { // 8.5.x 请求参数带特殊字符被tomcat拒绝 []|{}^\`"<> tomcat.getConnector().setProperty("relaxedQueryChars", "[]|{}^\`"<>"); setMaxPostSize(); + setMaxHttpHeaderSize(); String docBase = new File(WorkContext.getCurrent().getPath()).getParent(); //内置的上下文使用工程目录比如webroot @@ -102,6 +106,17 @@ public class FineEmbedServerActivator extends Activator { } } + private void setMaxHttpHeaderSize() { + String value = System.getProperty(TOMCAT_MAX_HEADER_SIZE); + if (StringUtils.isNotEmpty(value)) { + try { + tomcat.getConnector().setProperty("maxHttpHeaderSize", value); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + } + private void stopServerActivator() {