Closed sowinski closed 5 months ago
You can use https://caddyserver.com/docs/caddyfile/directives/handle_errors to write a custom response for specific errors
Yep, like Francis said, Caddy HTTP handlers will return a Go error value that bubbles up to the HTTP server, which then invokes error routes to handle the error if they are configured. So use handle_errors
to handle 429s.
Thank you. I ended up with this
caddy.handle_errors: 429
caddy.handle_errors.respond: "\"Too Many Requests. Please try again later.\""
Hi,
I successfully tested your rate limiter. If I hit the limit, I get a 429 message. But it is messing any content.
I would like to see something like "Too Many Requests. Please try again later." in my browser.
Not sure if is possible otherwise it would be nice to add this feature in later releases. From a user perspective this is not nice
Thank you and great work!