mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-14 12:46:05 +00:00
Support health
This commit is contained in:
parent
1eedbd9ff5
commit
573a3e0eb4
1 changed files with 4 additions and 3 deletions
|
|
@ -15,9 +15,10 @@ struct BasicAuthMiddleware<Context: RequestContext>: 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],
|
||||
|
|
|
|||
Loading…
Reference in a new issue