431 Request Header Fields Too Large
See original GitHub issueI 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:
exports.handler = (event, context) => {
delete event.multiValueHeaders;
return awsServerlessExpress.proxy(server, event, context)
}
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.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:13
Top Results From Across the Web
HTTP Error 431: 3 Ways to Fix Request Header Fields Too ...
The HTTP Error 431: Request Header Fields Too Large response status code indicates that the origin server refuses to fulfill users' requests.
Read more >How To Fix HTTP Error 431 Request Header Fields Too Large
The HTTP Error 431 Request Header Fields Too Large error is a client-side error that appears when your web browser makes a request...
Read more >HTTP Error 431: Definition, Status, Causes & Solutions | Okta
Error 431, which officially says "Request header fields too large," means the server has dropped the request. The header sent by the user...
Read more >the server responded with a status of 431 (Request Header ...
The HTTP 431 Request Header Fields Too Large response status code indicates that the server refuses to process the request because the ...
Read more >431 Request Header Fields Too Large - TooBigHeaders
This error occurs if the total size of all the request headers sent by the client application to Apigee Edge as part of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
http.maxHeaderSize can be overridden by
max-http-header-size
(nodejs >12.6, >10.15) https://nodejs.org/api/cli.html#cli_max_http_header_size_size (16KB on nodejs 14 by default)in package.json
@georgeevans1995 the solution initially suggested,
delete event.multiValueHeaders;
before passing the event toawsServerlessExpress.proxy
seems to work for us.