Skip to content

Commit

Permalink
feat: show warning on 431 response (#9324)
Browse files Browse the repository at this point in the history
Co-authored-by: Bjorn Lu <[email protected]>
  • Loading branch information
sapphi-red and bluwy authored Aug 10, 2022
1 parent 2ee3329 commit c02f325
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions guide/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ To solve this:
$ sudo sysctl fs.inotify.max_user_watches=524288
```

### 431 Request Header Fields Too Large

When the server / WebSocket server receives a large HTTP header, the request will be dropped and the following warning will be shown.

> Server responded with status code 431. See https://vitejs.dev/guide/troubleshooting.html#_431-request-header-fields-too-large.
This is because Node.js limits request header size to mitigate [CVE-2018-12121](https://www.cve.org/CVERecord?id=CVE-2018-12121).

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.

## HMR

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

0 comments on commit c02f325

Please sign in to comment.