mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-27 15:17:38 +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 {
|
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
|
// Skip auth for health check endpoint
|
||||||
// So we'll authenticate all requests when password is set
|
if request.uri.path == "/api/health" {
|
||||||
// The server bind address (127.0.0.1 vs 0.0.0.0) already controls network access
|
return try await next(request, context)
|
||||||
|
}
|
||||||
|
|
||||||
// Extract authorization header
|
// Extract authorization header
|
||||||
guard let authHeader = request.headers[.authorization],
|
guard let authHeader = request.headers[.authorization],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue