From 573a3e0eb4970ec8d2c8809efd59111b1288e86d Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 16 Jun 2025 20:31:14 +0200 Subject: [PATCH] Support health --- VibeTunnel/Core/Services/BasicAuthMiddleware.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/VibeTunnel/Core/Services/BasicAuthMiddleware.swift b/VibeTunnel/Core/Services/BasicAuthMiddleware.swift index 1a99e64c..0439917d 100644 --- a/VibeTunnel/Core/Services/BasicAuthMiddleware.swift +++ b/VibeTunnel/Core/Services/BasicAuthMiddleware.swift @@ -15,9 +15,10 @@ struct BasicAuthMiddleware: RouterMiddleware { } func handle(_ request: Request, context: Context, next: (Request, Context) async throws -> Response) async throws -> Response { - // For BasicRequestContext, we can't easily check if it's localhost - // So we'll authenticate all requests when password is set - // The server bind address (127.0.0.1 vs 0.0.0.0) already controls network access + // Skip auth for health check endpoint + if request.uri.path == "/api/health" { + return try await next(request, context) + } // Extract authorization header guard let authHeader = request.headers[.authorization],