如何在Spring Boot 2.x应用程序中设置max-http-header-size [英] How to set max-http-header-size in spring boot 2.x application

查看:87
本文介绍了如何在Spring Boot 2.x应用程序中设置max-http-header-size的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有运行Java 11的Spring启动应用程序:

I have Spring boot app running Java 11:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>

我收到错误消息: java.lang.IllegalArgumentException:请求标头太大

如何增加 max-http-header-size ?

推荐答案

您应在"application.properties"文件上进行设置:

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

server.max-http-header-size=48000

48000是过多标头的示例,放置所需的任何内容.

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

这篇关于如何在Spring Boot 2.x应用程序中设置max-http-header-size的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆