💥 Update server readiness header
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ builder.Services.AddCors(options =>
|
|||||||
.AllowAnyMethod()
|
.AllowAnyMethod()
|
||||||
.AllowAnyHeader()
|
.AllowAnyHeader()
|
||||||
.AllowCredentials()
|
.AllowCredentials()
|
||||||
.WithExposedHeaders("X-Total");
|
.WithExposedHeaders("X-Total", "X-NotReady");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user