Created
September 19, 2024 08:07
-
-
Save hunzo/c6ccde6929cf7c534df247493563462c to your computer and use it in GitHub Desktop.
fix error "431 Request Header Too Large" in golang fiber
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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