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

Is AllowCors necessary to dynamic options loaders? #406

Open
guitavano opened this issue Feb 16, 2024 · 0 comments
Open

Is AllowCors necessary to dynamic options loaders? #406

guitavano opened this issue Feb 16, 2024 · 0 comments

Comments

@guitavano
Copy link
Contributor

guitavano commented Feb 16, 2024

Issue Type

Please select the type of issue you are reporting:

  • Bug Report

Description

For dynamic options loaders, we are using this code to avoid CORS.

Object.entries(allowCorsFor(req)).map(([name, value]) => {
  ctx.response.headers.set(name, value);
});

However, requests from the admin panel should not encounter CORS problems.

Steps to Reproduce (for bugs)

  1. Run a store with deco and apps referenced
  2. Remove allowCors code from one of dynamic loaders
  • vtex/loaders/options/productIdByTerm.ts
  1. The dynamic options select will not work

Expected Behavior

Our admin should be able to do request to loaders without this allowCors explicity.

@guitavano guitavano changed the title Is AllowCore necessary? Is AllowCors necessary to dynamic options loaders? Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant