【Spring Cloud】异常记录

【Spring Cloud】异常记录

============================================================

1、feigin status 400 reading 请求头长度不够

2、Canonical names should be kebab-case ('-' separated), lowercase alpha-numeric characters and must start with a letter

============================================================

1、feigin status 400 reading 请求头长度不够

指定长度为10M

server:
  max-http-header-size: 10485760

 

2、Canonical names should be kebab-case ('-' separated), lowercase alpha-numeric characters and must start with a letter

user-config:
  contact-address: beijing
@Configuration
@ConfigurationProperties(prefix = "user-config")
public class UserConfig {
    String contactAddress;
}

@ConfigurationProperties 必须使用 kebab-case 短横线,不能使用驼峰,配置中的属性 contact-address 测试发现 kebab-case 和 驼峰都可以,但是建议使用 kebab-case 因为 spring boot 2.x 对配置格式进行了强制要求。

posted @ 2020-05-26 14:09  翠微  阅读(290)  评论(0编辑  收藏  举报