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

The Cors module supports ExposedHeaders #15499

Closed
hyzx86 opened this issue Mar 13, 2024 · 3 comments
Closed

The Cors module supports ExposedHeaders #15499

hyzx86 opened this issue Mar 13, 2024 · 3 comments
Milestone

Comments

@hyzx86
Copy link
Contributor

hyzx86 commented Mar 13, 2024

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 the Origin property?

Describe the solution you'd like

My recommendation is to configure directly to the default policy

policy.ExposedHeaders.Add(HeaderNames.ContentDisposition);

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

@sebastienros
Copy link
Member

Are there any existing APIs in Orchard that generate files and don't set this header?

@sebastienros sebastienros added this to the backlog milestone Mar 14, 2024
@hyzx86
Copy link
Contributor Author

hyzx86 commented Mar 14, 2024

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.

@hyzx86
Copy link
Contributor Author

hyzx86 commented Mar 21, 2024

Indeed, it should be implemented in custom code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants