You can access /health without a api key now.
All checks were successful
continuous-integration/drone/pr Build is passing
All checks were successful
continuous-integration/drone/pr Build is passing
This commit is contained in:
parent
db6f140858
commit
a3b1904923
@ -13,6 +13,13 @@ public class ApiKeyAuthAuthentication
|
|||||||
|
|
||||||
public async Task InvokeAsync(HttpContext context)
|
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))
|
if (!context.Request.Headers.TryGetValue(HeaderApiKey, out var extractedApiKey))
|
||||||
{
|
{
|
||||||
context.Response.StatusCode = 401;
|
context.Response.StatusCode = 401;
|
||||||
|
Loading…
Reference in New Issue
Block a user