zouyu
2026-04-03 625c4f2816d171bbe8cf264e23d3bec0c11e3b86
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package com.chinaztt.mes.docx.config;
 
import org.apache.catalina.connector.Connector;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
 
@Configuration
public class TomcatConfig {
    @Bean
    public TomcatServletWebServerFactory webServerFactory() {
        TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory();
        factory.addConnectorCustomizers((Connector connector) -> {
            connector.setProperty("relaxedPathChars", "\"<>[\\]^`{|}.");
            connector.setProperty("relaxedQueryChars", "\"<>[\\]^`{|}.");
        });
        return factory;
    }
}