diff --git a/.drone.yml b/.drone.yml index 53131e0..bff520d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -14,7 +14,11 @@ steps: - latest trigger: branch: - - master + include: + - master + event: + exclude: + - pull_request --- kind: pipeline diff --git a/Newsbot.Collector.Api/Middleware/ApiKeyAuthentication.cs b/Newsbot.Collector.Api/Middleware/ApiKeyAuthentication.cs index 9837003..59afbb2 100644 --- a/Newsbot.Collector.Api/Middleware/ApiKeyAuthentication.cs +++ b/Newsbot.Collector.Api/Middleware/ApiKeyAuthentication.cs @@ -13,6 +13,13 @@ public class ApiKeyAuthAuthentication public async Task InvokeAsync(HttpContext context) { + // allow access to /health without auth + if (context.Request.Path == "/health") + { + await _next(context); + return; + } + if (!context.Request.Headers.TryGetValue(HeaderApiKey, out var extractedApiKey)) { context.Response.StatusCode = 401;