-
Notifications
You must be signed in to change notification settings - Fork 669
431 Request Header Fields Too Large #248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @larrybolt, I am facing the same issue with a typescript-express project could you please share any information if you have done or found anything? |
I changed library to serverless-http and it worked |
Has anyone found a solution to this without using serverless-http? It only seems to be happening when you are using later versions of node. If I run version 8.10 everything works, but as AWS is deprecating this version I would like to run things locally on the correct versions. |
@georgeevans1995 the solution initially suggested, |
@larrybolt Sorry I should have said in my previous comment, I tried this but I still got the same error. |
Just to add some more detail to this from some testing, the error only seems to occur when I have an authorizer attached to the handler. I'm not sure how or why this would make a difference though? |
"Newer" versions of Nodejs limited the size of request headers to 8K. What When running with I guess there is no easy fix for this, besides downgrading nodejs to the version that has limit of 80K (e.g. |
Why was this closed (without a comment)? This is still a major problem and from what I can see the only workarounds are "use an old Node version" or "use another library", neither of which is a practical solution. |
@jchadwick Sorry about that, didn't know it was still relevant. Based on the comments it seemed like it was an issue with NodeJS and does work once deployed, thus more an issue with Hmm now thinking about it.. it might be possible to fix this with a serverless plugin for those using serverless-offline. But that would be more of a hack. |
This is very limiting, passing a large id_token for example, across the query path also invalidates the request. It is not just serverless-offline that is padding the payload. |
http.maxHeaderSize can be overridden by in package.json
|
Building on top of that I'm using this as a workaround: |
Fixed in v4 |
I tend to get a 431 Request Header Fields Too Large error with express when running
serverless offline start
(serverless-offline plugin). Deleting event.multiValueHeaders fixes it, but it might break other things, I need to do more research:The project where I'm having this issue is also using serverless-typescript though.
This issue was very annoying to find so therefor sorry for lack of other information, I'll try to update this issue if I find out more.
The text was updated successfully, but these errors were encountered: