陈昶聿
23 小时以前 a0fb494a8a1d75c0ad52816403282d7175faca10
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package com.ruoyi.web.core.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;
    }
}