How to set max-http-header-size in spring boot 2.x application

后端 未结 4 1824
一整个雨季
一整个雨季 2021-01-11 14:54

I have Spring boot app running Java 11:


    org.springframework.boot
    spring-boot-star         


        
相关标签:
4条回答
  • 2021-01-11 15:18

    You should set on the "application.properties" file:

    server.max-http-header-size=48000
    

    48000 is an example of an excessive header, put whatever you want.

    0 讨论(0)
  • 2021-01-11 15:31

    In spring boot 1.3.5.RELEASE what worked for me is setting the following entry in application.properties:

    server.tomcat.max-http-header-size=100000
    
    0 讨论(0)
  • 2021-01-11 15:33

    From Spring boot 2.1, you will now need to use a DataSize parsable value. e.g.

    server.max-http-header-size=40KB
    
    0 讨论(0)
  • 2021-01-11 15:38

    Please try server.max-http-header-size. I have found it here: Common application properties.

    The default value for Tomcat and Jetty is 8KB and for Undertow is 1MB.

    0 讨论(0)
提交回复
热议问题