aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Program.cs
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2023-01-28 16:59:25 -0600
committerGitHub <noreply@github.com>2023-01-28 16:59:25 -0600
commit83339dae0d486aeb76db74a807297566943424c6 (patch)
tree0bb95fc31366aebf7379daeafded87b8958587a4 /src/slskd/Program.cs
parent4869e19fb7b663387755e8751847acc2d925c41a (diff)
parent3010a89000fd08e0e5688d232c3cf70a98e6f8f2 (diff)
downloadslskd-83339dae0d486aeb76db74a807297566943424c6.tar.gz
Merge pull request #866 from slskd/endpoints
Suppress ASP0014
Diffstat (limited to 'src/slskd/Program.cs')
-rw-r--r--src/slskd/Program.cs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs
index c13cfdf1..5d7c37e1 100644
--- a/src/slskd/Program.cs
+++ b/src/slskd/Program.cs
@@ -841,6 +841,11 @@ namespace slskd
app.UseAuthentication();
app.UseRouting();
app.UseAuthorization();
+
+ // starting with .NET 7 the framework *really* wants you to use top level endpoint mapping
+ // for whatever reason this breaks everything, and i just can't bring myself to care unless
+ // UseEndpoints is going to be deprecated or if there's some material benefit
+#pragma warning disable ASP0014 // Suggest using top level route registrations
app.UseEndpoints(endpoints =>
{
endpoints.MapHub<ApplicationHub>("/hub/application");
@@ -885,6 +890,7 @@ namespace slskd
});
}
});
+#pragma warning restore ASP0014 // Suggest using top level route registrations
// if this is an /api route and no API controller was matched, give up and return a 404.
app.Use(async (context, next) =>