Skip to content

Commit

Permalink
Please?
Browse files Browse the repository at this point in the history
  • Loading branch information
VasilisThePikachu authored Jun 17, 2024
1 parent d96b026 commit 311ad97
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions SS14.ServerHub/Controllers/ServerListController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public async Task<IEnumerable<ServerInfo>> Get()

return dbInfos;
}

[EnableCors(CorsPolicies.PolicyHubPublic)]
[HttpGet("info")]
public async Task<IActionResult> GetServerInfo(string url)
Expand All @@ -65,7 +65,7 @@ public async Task<IActionResult> GetServerInfo(string url)

if (dbInfo == null)
return NotFound();

return Ok((RawJson?) dbInfo.InfoData);
}

Expand Down Expand Up @@ -149,7 +149,7 @@ parsedAddress.Scheme is not (Ss14UriHelper.SchemeSs14 or Ss14UriHelper.SchemeSs1
StatusData = statusJson,
InferredTags = inferredTags
});

await _dbContext.SaveChangesAsync();
return NoContent();
}
Expand All @@ -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<ServerStatus>(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);

Expand Down

0 comments on commit 311ad97

Please sign in to comment.