com.lx.boot.web.ScTomcatWebServerCustomizer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lxboot3 Show documentation
Show all versions of lxboot3 Show documentation
使用文档: https://a7fi97h1rc.feishu.cn/docx/X3LRdtLhkoXQ8hxgXDQc2CLOnEg?from=from_copylink
package com.lx.boot.web;
import org.apache.catalina.connector.Connector;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.stereotype.Component;
//说明: 解决tomcat get请求不能携带|{}[] 特殊字符
/**{ ylx } 2022/4/2 14:46 */
@Component
public class ScTomcatWebServerCustomizer implements WebServerFactoryCustomizer {
public ScTomcatWebServerCustomizer() {
}
@Override
public void customize(TomcatServletWebServerFactory factory) {
factory.addConnectorCustomizers((Connector connector) -> {
connector.setProperty("relaxedPathChars", "\"<>[\\]^`{|}");
connector.setProperty("relaxedQueryChars", "\"<>[\\]^`{|}");
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy