Spring Boot报错:java.lang.IllegalArgumentException: An invalid character [..] was present in the Cooki
Posted 月下梦花落
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Spring Boot报错:java.lang.IllegalArgumentException: An invalid character [..] was present in the Cooki相关的知识,希望对你有一定的参考价值。
@Configuration
public class CookieConfig {
/**
* 解决问题:
* There was an unexpected error (type=Internal Server Error, status=500).
* An invalid domain [.localhost.com] was specified for this cookie
*
* @return
*/
@Bean
public WebServerFactoryCustomizer<TomcatServletWebServerFactory> cookieProcessorCustomizer() {
return (factory) -> factory.addContextCustomizers(
(context) -> context.setCookieProcessor(new LegacyCookieProcessor()));
}
}
补充cookie坑,同一个服务器,前端访问IP地址cookie存在IP地址下,访问域名cookie存在域名下
以上是关于Spring Boot报错:java.lang.IllegalArgumentException: An invalid character [..] was present in the Cooki的主要内容,如果未能解决你的问题,请参考以下文章
处理spring-boot-starter-quartz和spring-boot-starter-websocket同时使用报错