Skip to content

Instantly share code, notes, and snippets.

@hunzo
Created September 19, 2024 08:07
Show Gist options
  • Save hunzo/c6ccde6929cf7c534df247493563462c to your computer and use it in GitHub Desktop.
Save hunzo/c6ccde6929cf7c534df247493563462c to your computer and use it in GitHub Desktop.
fix error "431 Request Header Too Large" in golang fiber
package main
import (
"github.com/gofiber/fiber/v2"
)
func main() {
app := fiber.New(fiber.Config{
// Default is 8192 (8 KB), you can increase it to a higher value
ReadBufferSize: 16 * 1024, // 16 KB, increase as needed
})
app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})
app.Listen(":3000")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment