Unverified Commit a330519f authored by bearBoy80's avatar bearBoy80 Committed by GitHub
Browse files

优化tomcat配置relaxedQueryChars方式,采用TomcatConnectorCustomizer来实现 (#764)

* Create RelaxedQueryCharsConnectorCustomizer

* delete tomcat relaxedQueryChars code

* 优化tomcat配置relaxedQueryChars方式
parent 7a7fb53e
...@@ -56,13 +56,6 @@ public class AppRun { ...@@ -56,13 +56,6 @@ public class AppRun {
return new SpringContextHolder(); return new SpringContextHolder();
} }
@Bean
public ServletWebServerFactory webServerFactory() {
TomcatServletWebServerFactory fa = new TomcatServletWebServerFactory();
fa.addConnectorCustomizers(connector -> connector.setProperty("relaxedQueryChars", "[]{}"));
return fa;
}
/** /**
* 访问首页提示 * 访问首页提示
* *
......
package me.zhengjie.config;
import org.apache.catalina.connector.Connector;
import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer;
import org.springframework.context.annotation.Configuration;
/**
* @author bearBoy80
*/
@Configuration(proxyBeanMethods = false)
public class RelaxedQueryCharsConnectorCustomizer implements TomcatConnectorCustomizer {
@Override
public void customize(Connector connector) {
connector.setProperty("relaxedQueryChars", "[]{}");
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment