首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >java Request header is too large

java Request header is too large

作者头像
葫芦
发布2022-03-16 21:19:00
7560
发布2022-03-16 21:19:00
举报
文章被收录于专栏:葫芦葫芦葫芦

背景

个别用户反馈无法登录

调查

查看日志找到一条错误记录:

java.lang.IllegalArgumentException: Request header is too large

定位原因

一个request中 总的header超过了8kb,其中jwt token就超过了6kb,加上其他杂七杂八的header超过了8kb.

tomcat 8版本 默认不允许超过 8kb

tomcat 5版本 默认不允许超过 4kb

临时解决

在报错的服务上增加配置 application.xml

server:
    ....
    max-http-header-size:16KB
    ....

最终解决

减少jwt token拼接的无用数据量,减少request header 大小.

Background

Feedback from a few users feedback can not logon

Log Error

java.lang.IllegalArgumentException: Request header is too large

Positioning reason

The JWT token in the header exceeds 6kb, and the total request header exceeds 8kb. The default value allowed in Tomcat embedded in Spring Boot is that the Request header cannot exceed 8kb.

tomcat 8 < 8kb

tomcat 5 < 4kb

Temporary solution

Set max-http-header-size to 16K in the recived service

Final solution

Reduce the amount of useless data for JWT token stitching and reduce the size of request Headers.

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 背景
  • 调查
  • 定位原因
  • 临时解决
  • 最终解决
  • Background
  • Log Error
  • Positioning reason
  • Temporary solution
  • Final solution
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档