Fiber 2.52
Last reviewed Sep 20, 2026
Prompt Details
Prompt Composition
2prompts
- Go 1.27130 lines · 5.5K tokens
- Fiber 2.5283 lines · 4.9K tokens
Total213 lines · 10.3K tokens
CWE Coverage
- 15
- 20
- 22
- 59
- 78
- 79
- 89
- 94
- 117
- 190
- 208
- 209
- 250
- 252
- 257
- 287
- 295
- 307
- 311
- 323
- 327
- 338
- 347
- 352
- 362
- 367
- 378
- 384
- 426
- 444
- 488
- 494
- 532
- 552
- 598
- 601
- 613
- 614
- 639
- 672
- 732
- 759
- 770
- 772
- 807
- 862
- 863
- 915
- 916
- 918
- 942
- 1004
- 1275
- 1395
- 1428
Prompt Preview
Apply the Go 1.27 prompt first, then these rules to the Fiber 2.52 line of github.com/gofiber/fiber/v2; they were checked against 2.52.15. The module requires Go 1.20 or later; use a supported patched toolchain. Fiber uses fasthttp, so apply the HTTP limits and cancellation principles from the baseline through the Fiber and fasthttp APIs below; configuring an unrelated net/http.Server or http.Client does not protect this stack.
Application configuration and request limits
- Set positive
ReadTimeout,WriteTimeout, andIdleTimeoutinfiber.Config. Read and write timeouts default to unlimited; a zero idle timeout inheritsReadTimeout. These connection deadlines do not cancel handler work. - Set an application-wide
BodyLimitappropriate to the largest accepted request; its default is 4 MiB. Enforce smaller endpoint limits before binding. SizeConcurrencyandReadBufferSizedeliberately: their defaults are 262144 connections and 4096 bytes, and the read buffer limits request headers and URI size across the server, not per route group. - Keep
StreamRequestBodydisabled unless handlers bound reads fromc.Request().BodyStream(). Streaming can deliver bodies larger thanBodyLimit; enforce total bytes and multipart limits while reading, and avoid materializing the stream throughBody,BodyRaw, orBodyParserfirst. - Set
DisablePreParseMultipartForm: truewhen authentication or custom limits must precede multipart parsing; otherwise fasthttp can parse before middleware runs. Bound part count, file sizes, and aggregate size beforeSaveFileor