mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-24 13:36:50 +01:00
Fix issue with CORS not working properly
This commit is contained in:
@@ -472,6 +472,9 @@ namespace Tgstation.Server.Host.Core
|
||||
logger.LogTrace("Swagger API generation enabled");
|
||||
}
|
||||
|
||||
// Enable endpoint routing
|
||||
applicationBuilder.UseRouting();
|
||||
|
||||
// Set up CORS based on configuration if necessary
|
||||
Action<CorsPolicyBuilder> corsBuilder = null;
|
||||
if (controlPanelConfiguration.AllowAnyOrigin)
|
||||
@@ -514,9 +517,6 @@ namespace Tgstation.Server.Host.Core
|
||||
logger.LogTrace("Web control panel disabled!");
|
||||
#endif
|
||||
|
||||
// Stack overflow said this needs to go here and removing it breaks things: https://stackoverflow.com/questions/73736879/invalidoperationexception-endpointroutingmiddleware-matches-endpoints-setup-by
|
||||
applicationBuilder.UseRouting();
|
||||
|
||||
// authenticate JWT tokens using our security pipeline if present, returns 401 if bad
|
||||
applicationBuilder.UseAuthentication();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user