💥 Update server readiness header

This commit is contained in:
2025-12-24 23:07:57 +08:00
parent 213608d4f0
commit 7811545726
2 changed files with 2 additions and 2 deletions

View File

@@ -25,7 +25,7 @@ public sealed class GatewayReadinessMiddleware(RequestDelegate next)
{ {
context.Response.StatusCode = StatusCodes.Status503ServiceUnavailable; context.Response.StatusCode = StatusCodes.Status503ServiceUnavailable;
var unavailableServices = string.Join(", ", notReadyCoreServices); var unavailableServices = string.Join(", ", notReadyCoreServices);
context.Response.Headers["X-NotReady-Services"] = unavailableServices; context.Response.Headers["X-NotReady"] = unavailableServices;
await context.Response.WriteAsync("Solar Network is warming up. Try again later please."); await context.Response.WriteAsync("Solar Network is warming up. Try again later please.");
return; return;
} }

View File

@@ -25,7 +25,7 @@ builder.Services.AddCors(options =>
.AllowAnyMethod() .AllowAnyMethod()
.AllowAnyHeader() .AllowAnyHeader()
.AllowCredentials() .AllowCredentials()
.WithExposedHeaders("X-Total"); .WithExposedHeaders("X-Total", "X-NotReady");
}); });
}); });