mirror of
https://github.com/Dictionarry-Hub/profilarr.git
synced 2026-01-28 21:40:58 +01:00
fix: return appropriate HTTP status based on health check
This commit is contained in:
@@ -34,10 +34,10 @@ export const GET: RequestHandler = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
// Determine overall status
|
||||
response.status = determineOverallStatus(response.components);
|
||||
|
||||
return json(response);
|
||||
const httpStatus = response.status === 'unhealthy' ? 503 : 200;
|
||||
return json(response, { status: httpStatus });
|
||||
};
|
||||
|
||||
function determineOverallStatus(components: HealthResponse['components']): ComponentStatus {
|
||||
|
||||
Reference in New Issue
Block a user