Solve the problem that the Request header is too large Header is too large

Solve the problem that the Request header is too large header is too large

Question:
insert image description here
What caused it?

Since my header uses the token transmission in jwt encrypted form, token = user identity information + authority + role...
In this way, if the user has more authority or role identity, the length of the token will be longer, so the header will appear The message is too long.
That is, the request header exceeds the limit of tomcat. Originally, the post request has no parameter size limit, but the server has its own default size.

solution:

  • Pay attention to the SpringCloud project, remember to configure each module

This configuration in the application configuration file can be perfectly solved.


#解决header头标token过大的问题
server.max-http-header-size=102400

insert image description here

Guess you like

Origin blog.csdn.net/m0_43413873/article/details/115459997