Commit 1c2fc1d
committed
fix(http): handle oversized response header in FileCache send path
FileCache reserves a fixed block before the file content so header+body
can be sent as one buffer. prepend_header() previously returned void and
silently did nothing when the header exceeded the reserve (1K): the file
was then served with a missing/garbage header and the caller had no way to
know.
- Bump the reserve from 1K to 4K (covers normal responses incl. long
cookies / CORS / CSP headers), so the fast single-buffer path is taken
in practice.
- prepend_header() now returns bool. When the header still doesn't fit,
HttpHandler falls back to sending the header first, then the file
content (pResp->content already points at fc->filebuf) via the existing
SEND_BODY state -- correct instead of silently broken.
Verified: normal static file serve unchanged; a response with a >4K header
still delivers both the full header and the intact file body.
Minimal alternative to #823 (avoids its LRU/concurrency/config rework).1 parent 2bd2061 commit 1c2fc1d
2 files changed
Lines changed: 20 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
| 60 | + | |
56 | 61 | | |
57 | 62 | | |
58 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
856 | 856 | | |
857 | 857 | | |
858 | 858 | | |
859 | | - | |
860 | | - | |
861 | | - | |
862 | | - | |
863 | | - | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
864 | 871 | | |
865 | 872 | | |
866 | 873 | | |
| |||
0 commit comments