移除针对 tomcat 的配置
parent
49685e545b
commit
01213c5d02
|
@ -1,19 +0,0 @@
|
||||||
package cn.keking.config;
|
|
||||||
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author chenjh
|
|
||||||
* @since 2020/5/18 13:41
|
|
||||||
*/
|
|
||||||
@Configuration
|
|
||||||
public class RFCConfig {
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public Boolean setRequestTargetAllow() {
|
|
||||||
// RFC 7230,RFC 3986规范不允许url相关特殊字符,手动指定Tomcat url允许特殊符号, 如{}做入参,其他符号按需添加。见tomcat的HttpParser源码。
|
|
||||||
System.setProperty("tomcat.util.http.parser.HttpParser.requestTargetAllow", "|{}");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -4,14 +4,14 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author: chenjh
|
* @author: chenjh
|
||||||
* @since: 2019/4/16 20:04
|
* @since: 2019/4/16 20:04
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
public class WebConfig extends WebMvcConfigurerAdapter {
|
public class WebConfig implements WebMvcConfigurer {
|
||||||
|
|
||||||
private final static Logger LOGGER = LoggerFactory.getLogger(WebConfig.class);
|
private final static Logger LOGGER = LoggerFactory.getLogger(WebConfig.class);
|
||||||
/**
|
/**
|
||||||
|
@ -22,6 +22,5 @@ public class WebConfig extends WebMvcConfigurerAdapter {
|
||||||
String filePath = ConfigConstants.getFileDir();
|
String filePath = ConfigConstants.getFileDir();
|
||||||
LOGGER.info("Add resource locations: {}", filePath);
|
LOGGER.info("Add resource locations: {}", filePath);
|
||||||
registry.addResourceHandler("/**").addResourceLocations("classpath:/META-INF/resources/","classpath:/resources/","classpath:/static/","classpath:/public/","file:" + filePath);
|
registry.addResourceHandler("/**").addResourceLocations("classpath:/META-INF/resources/","classpath:/resources/","classpath:/static/","classpath:/public/","file:" + filePath);
|
||||||
super.addResourceHandlers(registry);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue