From 311ad9714f09a5e564fb50fcec8fde39dd59e0bb Mon Sep 17 00:00:00 2001 From: Vasilis Date: Mon, 17 Jun 2024 15:03:57 +0200 Subject: [PATCH] Please? --- SS14.ServerHub/Controllers/ServerListController.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SS14.ServerHub/Controllers/ServerListController.cs b/SS14.ServerHub/Controllers/ServerListController.cs index 294f0c5..a2cf1c4 100644 --- a/SS14.ServerHub/Controllers/ServerListController.cs +++ b/SS14.ServerHub/Controllers/ServerListController.cs @@ -53,7 +53,7 @@ public async Task> Get() return dbInfos; } - + [EnableCors(CorsPolicies.PolicyHubPublic)] [HttpGet("info")] public async Task GetServerInfo(string url) @@ -65,7 +65,7 @@ public async Task GetServerInfo(string url) if (dbInfo == null) return NotFound(); - + return Ok((RawJson?) dbInfo.InfoData); } @@ -149,7 +149,7 @@ parsedAddress.Scheme is not (Ss14UriHelper.SchemeSs14 or Ss14UriHelper.SchemeSs1 StatusData = statusJson, InferredTags = inferredTags }); - + await _dbContext.SaveChangesAsync(); return NoContent(); } @@ -176,11 +176,11 @@ parsedAddress.Scheme is not (Ss14UriHelper.SchemeSs14 or Ss14UriHelper.SchemeSs1 { return (UnprocessableEntity($"/status response data was too large (max: {maxStatusSize} KiB)"), null, null); } - + var statusData = JsonSerializer.Deserialize(statusResponse); if (statusData == null) throw new InvalidDataException("Status cannot be null"); - + if (string.IsNullOrWhiteSpace(statusData.Name)) return (UnprocessableEntity("Server name cannot be empty"), null, null);