.NET backend: CORS headers set by mapservice should be optional #968
Labels
difficulty:easy
Functionality is considered easy to port
module:backend
MapService stuff
.NET
Pull requests that update .net code
priority:normal
Milestone
Is your feature request related to a problem? Please describe.
The .NET Backend is designed to always set and return CORS headers to the client using C# code. In simple installations this might be what you want. In more advanced installations you really want to do this by installing and using the IIS CORS Module, not by application code.
To get the same functionality using the CORS Module you have to add 3-5 lines in Web.config.
Example of C# code is found in the AllowCrossSiteJsonAttribute.cs file and the ExportController.cs file, function [HttpOptions] PDF.
There is a risk that headers set by the application will interfer with the headers set by the CORS Module.
Describe the solution you'd like
Add a compiler setting that will remove the CORS code from the .NET Backend if enabled.
The compiler setting should default to keep the CORS code.
Describe alternatives you've considered
Remove the CORS code altogether, but this might break existing installations.
Additional context
The text was updated successfully, but these errors were encountered: