SpringBoot :Error parsing HTTP request header [How to Solve]

Most of these problems are container problems. There are two solutions:

1. Maybe the header cache in Tomcat is not enough

  tomcat:
    # URI encoding of tomcat
     uri-encoding: UTF-8
     # tomcat maximum number of threads, the default is 200
     max-threads: 800
     # Tomcat starts the number of threads to initialize, the default value is 25
    min-spare-threads: 30
    max-http-form-post-size: 2MB
    max-http-header-size: 8096

2. If it hasn’t been solved

@Configuration
public class TomcatConfigurer {

    @Bean
    public TomcatServletWebServerFactory webServerFactory() {
        TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory();
        factory.addConnectorCustomizers((Connector connector) -> {
            connector.setProperty("relaxedPathChars", "\"<>[\\]^`{|}");
            connector.setProperty("relaxedQueryChars", "\"<>[\\]^`{|}");
        });
        return factory;
    }

}

Read More: