Closed hyzx86 closed 7 months ago
Are there any existing APIs in Orchard that generate files and don't set this header?
Are there any existing APIs in Orchard that generate files and don't set this header?
Probably not, because most of the current OC is used directly through MVC pages, so they are homologous, this configuration only needs to be configured when cross-domain requests are made.
Indeed, it should be implemented in custom code
Is your feature request related to a problem? Please describe.
Asynchronous file download scenarios require the api to include the file name in the response header. Just like
attachment; filename="myfile.xlsx";
Because some scenarios may need to generate download files through user submitted data, but this request is a cross-domain request initiated through WebApi. Then in this case, do we hardcode
ContentDisposition
for the default policy directly after the user has enabled the Cors module, or provide an option for the user to fill in, just like theOrigin
property?Describe the solution you'd like
My recommendation is to configure directly to the default policy
Describe alternatives you've considered
Providing a drop-down menu or text box for the user to choose from may increase the cost of development and learning. Or provide a Json version for the user to configure directly