fixes for avoid network error in client

- return 200 OK for /ContentWebService.asmx
- return 404 (and log error) on connection error to asset provider server
This commit is contained in:
Robert Paciorek 2024-04-12 10:02:53 +00:00
parent d00a2f770c
commit d1258b6082
2 changed files with 4 additions and 2 deletions

View File

@ -14,6 +14,7 @@ namespace sodoff.Controllers.Common
} }
[Route("ping")] [Route("ping")]
[Route("ContentWebService.asmx")] // ping URL used by SoD
public IActionResult Ping() public IActionResult Ping()
{ {
return Ok(); return Ok();

View File

@ -138,11 +138,12 @@ public class AssetMiddleware
} }
} }
} }
catch (Exception) { catch (Exception err) {
Console.WriteLine($"{err}");
if (File.Exists(filePathTmp)) if (File.Exists(filePathTmp))
File.Delete(filePathTmp); File.Delete(filePathTmp);
if (!context.Response.HasStarted) if (!context.Response.HasStarted)
context.Response.StatusCode = 502; context.Response.StatusCode = 404;
} }
} }