Skip to content

Commit c02f325

Browse files
sapphi-redbluwy
andauthored
feat: show warning on 431 response (#9324)
Co-authored-by: Bjorn Lu <[email protected]>
1 parent 2ee3329 commit c02f325

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

guide/troubleshooting.md

+10
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ To solve this:
4444
$ sudo sysctl fs.inotify.max_user_watches=524288
4545
```
4646

47+
### 431 Request Header Fields Too Large
48+
49+
When the server / WebSocket server receives a large HTTP header, the request will be dropped and the following warning will be shown.
50+
51+
> Server responded with status code 431. See https://vitejs.dev/guide/troubleshooting.html#_431-request-header-fields-too-large.
52+
53+
This is because Node.js limits request header size to mitigate [CVE-2018-12121](https://www.cve.org/CVERecord?id=CVE-2018-12121).
54+
55+
To avoid this, try to reduce your request header size. For example, if the cookie is long, delete it. Or you can use [`--max-http-header-size`](https://nodejs.org/api/cli.html#--max-http-header-sizesize) to change max header size.
56+
4757
## HMR
4858

4959
### Vite detects a file change but the HMR is not working

0 commit comments

Comments
 (0)