I'm working on a NodeJS Server side app that uses Express to serve up REST Services. This is a microservice that handles authentication duties.

For some reason, I started getting 431 errors, which was causing lots of issues because the app couldn't validate the user, then forced them to re-login which was causing a loop.

What is a 431 error? It means the request header is too large.

Thankfully with NodeJS this is pretty easy to fix. We just specify the max-http-header-size command line argument when launching the NodeJS server.

I just had to do this:

view plain print about
1node --max-http-header-size=8192 index

This was interesting to me because a bunch of sites on the Internet say that 8192 is the default max-http=header-size. And the docs say 16384 is the default, and I specified it to a number lower than that to make it work.

But, at least my current problem is solved.

For those that find this, I'm currently running 12.22.1.