question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

431 Request Header Fields Too Large

See original GitHub issue

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:

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:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:13

github_iconTop GitHub Comments

4reactions
kennyhyuncommented, Jun 17, 2020

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

  "start": "node --max-http-header-size=16384 server.js",
3reactions
larryboltcommented, Nov 29, 2019

@georgeevans1995 the solution initially suggested, delete event.multiValueHeaders; before passing the event to awsServerlessExpress.proxy seems to work for us.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found