Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various bug fixes #126

Merged
merged 5 commits into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
- uses: actions/checkout@v4
- name: Initial static JSON schema submodule
run: git submodule update --init ./src/Helldivers-2-Models/json
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Generate OpenAPI JSON files
run: dotnet build -c Debug
- name: Copy README
Expand Down
19 changes: 10 additions & 9 deletions Helldivers-2.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Helldivers-2-API", "src\Hel
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C0ECDBEB-FC7B-4F3C-AF8F-D0961BD22F61}"
ProjectSection(SolutionItems) = preProject
.dockerignore = .dockerignore
.editorconfig = .editorconfig
.gitattributes = .gitattributes
.gitignore = .gitignore
Directory.Build.props = Directory.Build.props
fly.toml = fly.toml
.dockerignore = .dockerignore
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Helldivers-2-Models", "src\Helldivers-2-Models\Helldivers-2-Models.csproj", "{9B017849-C756-4B98-9B98-885AEBE9EAD4}"
Expand All @@ -27,19 +27,20 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Helldivers-2-SourceGen", "s
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Github", "Github", "{18D4A0EA-02CE-4FEA-A641-848A13603040}"
ProjectSection(SolutionItems) = preProject
.github\CODEOWNERS = .github\CODEOWNERS
CODE_OF_CONDUCT.md = CODE_OF_CONDUCT.md
CONTRIBUTING.md = CONTRIBUTING.md
LICENSE = LICENSE
README.md = README.md
SECURITY.md = SECURITY.md
LICENSE = LICENSE
CONTRIBUTING.md = CONTRIBUTING.md
.github\CODEOWNERS = .github\CODEOWNERS
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Workflows", "Workflows", "{9D663AC9-2CD8-4114-A802-D12284662FF0}"
ProjectSection(SolutionItems) = preProject
.github\workflows\codeql.yml = .github\workflows\codeql.yml
.github\workflows\dotnet.yml = .github\workflows\dotnet.yml
.github\workflows\fly.yml = .github\workflows\fly.yml
.github\workflows\pages.yml = .github\workflows\pages.yml
.github\workflows\dotnet.yml = .github\workflows\dotnet.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Templates", "Templates", "{FD5B9284-4689-48BE-B520-633C7269F97C}"
Expand Down Expand Up @@ -85,17 +86,17 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3511FD7F-508F-4E9A-ABEB-7F7656961728}
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{939EFFA5-462B-4F5F-969A-61B4C424407A} = {154421CC-393F-4BDC-8D6D-7EECB28FD874}
{9B017849-C756-4B98-9B98-885AEBE9EAD4} = {154421CC-393F-4BDC-8D6D-7EECB28FD874}
{CB53B78C-7AB2-4B39-98B0-394778AF882F} = {154421CC-393F-4BDC-8D6D-7EECB28FD874}
{939EFFA5-462B-4F5F-969A-61B4C424407A} = {154421CC-393F-4BDC-8D6D-7EECB28FD874}
{32AE19FB-7D9E-4AC7-A0A5-80DED3680369} = {154421CC-393F-4BDC-8D6D-7EECB28FD874}
{18D4A0EA-02CE-4FEA-A641-848A13603040} = {C0ECDBEB-FC7B-4F3C-AF8F-D0961BD22F61}
{9D663AC9-2CD8-4114-A802-D12284662FF0} = {18D4A0EA-02CE-4FEA-A641-848A13603040}
{FD5B9284-4689-48BE-B520-633C7269F97C} = {18D4A0EA-02CE-4FEA-A641-848A13603040}
{1A2CFD82-2D8E-4DA3-97A3-403BB478B6EB} = {C0ECDBEB-FC7B-4F3C-AF8F-D0961BD22F61}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3511FD7F-508F-4E9A-ABEB-7F7656961728}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public static async Task<IResult> Index(HttpContext context, IStore<SpaceStation
/// <summary>
/// Fetches a specific <see cref="SpaceStation" /> identified by <paramref name="index" />.
/// </summary>
[ProducesResponseType<SpaceStation>(StatusCodes.Status200OK)]
public static async Task<IResult> Show(HttpContext context, IStore<SpaceStation, int> store, [FromRoute] int index)
{
var station = await store.GetAsync(index, context.RequestAborted);
Expand Down
2 changes: 1 addition & 1 deletion src/Helldivers-2-API/Middlewares/RateLimitMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public async Task InvokeAsync(HttpContext context, RequestDelegate next)
/// </summary>
private bool IsValidRequest(HttpContext context)
{
if (options.Value.ValidateClients is false)
if (options.Value.ValidateClients is false || context.Request.Path.StartsWithSegments("/metrics"))
return true;

return context.Request.Headers.ContainsKey(Constants.CLIENT_HEADER_NAME)
Expand Down
1 change: 1 addition & 0 deletions src/Helldivers-2-Models/V1SerializerContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ namespace Helldivers.Models;
[JsonSerializable(typeof(SteamNews))]
[JsonSerializable(typeof(List<SteamNews>))]
[JsonSerializable(typeof(War))]
[JsonSerializable(typeof(List<SpaceStation>))]
[JsonSourceGenerationOptions(PropertyNameCaseInsensitive = true, UseStringEnumConverter = true)]
public sealed partial class V1SerializerContext : JsonSerializerContext
{
Expand Down