case 4586

This commit is contained in:
2024-05-07 19:54:41 +00:00
parent 297ffa7006
commit ad5db64b65
2 changed files with 5 additions and 2 deletions

View File

@@ -33,10 +33,12 @@ namespace AyaNova.Api.Controllers
[AllowAnonymous]
[ProducesResponseType(typeof(string), 200)]
[SwaggerOperation(OperationId = "Health_Get")]
[ResponseCache(Location = ResponseCacheLocation.None)]
public async Task<IActionResult> Get()
{
var report = await _healthCheckService.CheckHealthAsync();
Response.Headers.Add("Cache-Control", "no-store, no-cache");
//case 4586 - warning here due to .net update put into responsecache attribute instead
//Response.Headers.Add("Cache-Control", "no-store, no-cache");
return report.Status == HealthStatus.Healthy ? Ok(report.Status.ToString()) : StatusCode(503, report.Status.ToString());
}
}//eoc

View File

@@ -512,7 +512,8 @@ namespace AyaNova
if (!bLocalReportRenderRequest)
{
context.Response.StatusCode = 401;
context.Response.Headers.Add("X-AyaNova-Authorization-Error", "E2004 - Authorization token replaced by more recent login");
//case 4586
context.Response.Headers.Append("X-AyaNova-Authorization-Error", "E2004 - Authorization token replaced by more recent login");
await context.Response.WriteAsync("E2004 - Authorization token replaced by more recent login");
}
}