Skip to content

Conversation

@ziflex
Copy link
Member

@ziflex ziflex commented Feb 4, 2026

This pull request introduces improvements to the server's rate limiting functionality, making it more flexible and allowing certain routes to be excluded from rate limiting. It also introduces a constant for the health check route path and ensures the health check endpoint is not rate limited.

Rate limiting enhancements:

  • Added a RequestLimitSkipper option to the server, allowing custom logic to skip rate limiting for specific requests. The main application now uses this to exempt the health check endpoint from rate limiting. [1] [2]
  • Refactored the rate limiter configuration to use a more flexible calculation for rate and burst, and to support the new skipper function.

Health check endpoint improvements:

  • Introduced a HealthPath constant in internal/controllers/health.go and updated the route registration to use this constant, ensuring consistency and easier maintenance.
  • Updated the main application to use the new HealthPath constant when configuring the rate limit skipper.

Dependency update:

  • Added the echo/v4 package import to main.go to support the new skipper logic.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the server's rate limiting functionality by adding a skipper function to exclude specific routes (health checks) from rate limiting, and introduces a constant for the health check endpoint path for better maintainability.

Changes:

  • Added RequestLimitSkipper option to allow custom logic for skipping rate limiting on specific requests
  • Introduced HealthPath constant in the health controller for consistent route path management
  • Refactored rate limiter configuration to support the new skipper function and modify rate calculation logic

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
main.go Adds echo/v4 import and configures rate limit skipper to exempt health check endpoint
internal/server/server.go Adds RequestLimitSkipper option, refactors rate limiter configuration with new rate calculation, burst parameter, and modified ExpiresIn duration
internal/controllers/health.go Introduces HealthPath constant and updates route registration to use it

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ziflex and others added 2 commits February 4, 2026 18:14
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ziflex ziflex merged commit 81ccc35 into master Feb 4, 2026
4 checks passed
@ziflex ziflex deleted the fix/rate-limiter branch February 4, 2026 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant