Skip to content

Commit

Permalink
Add ping endpoint for testing
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Di Tommaso <[email protected]>
  • Loading branch information
pditommaso committed Oct 1, 2023
1 parent dc633b1 commit f97e714
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ class ServiceInfoController {
HttpResponse.ok(new ServiceInfoResponse(info))
}

@Get('/ping')
HttpResponse<ServiceInfoResponse> ping() {
HttpResponse.ok()
}

@Get("/")
HttpResponse landing() {
return landingUrl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ class RateLimiterFilter implements HttpServerFilter {
}

private Publisher<MutableHttpResponse<?>> limit0(HttpRequest<?> request, ServerFilterChain chain) {
if( request.path.startsWith('/ping') ) {
// ignore rate limit for ping endpoint
return chain.proceed(request)
}

final key = getKey(request);
final limiter = getLimiter(key);

Expand Down

0 comments on commit f97e714

Please sign in to comment.