pickware / shopware-platform

Shopware platform mono repository
https://shopware.com
MIT License
1 stars 1 forks source link

Allow sw-inheritance field in API request header #18

Closed hanneswernery closed 4 years ago

hanneswernery commented 4 years ago

1. Why is this change necessary?

When using the sw-inheritance header field in API requests an error is thrown, because the inheritance field is not allowed:

Access to XMLHttpRequest at 'http://localhost/shopware/api/v1/search/product' from origin 'http://localhost:8080' has been blocked by CORS policy: Request header field sw-inheritance is not allowed by Access-Control-Allow-Headers in preflight response.

2. What does this change do, exactly?

This PR fixes this by allowing the sw-inheritance field in requests headers.

3. Describe each step to reproduce the issue or behaviour.

The inheritance header is currently used in the sw-cms-el-config-product-box component: https://github.com/shopware/platform/blob/5c989b45b64c23d368f769bab906f4d26541e2d5/src/Administration/Resources/app/administration/src/module/sw-cms/elements/product-box/config/index.js#L21-L26 When using it and searching for products, the error is returned from the server.

4. Please link to the relevant issues (if any).

5. Checklist

ghost commented 4 years ago

Danger run resulted in 1 warning; to find out more, see the checks page.

Generated by :no_entry_sign: dangerJS

hanneswernery commented 4 years ago

This seems to be an issue with our dev server setup, not the Shopware code itself.

(e.g. it is working in Showpare's dev server setup or our demo shop).

hanneswernery commented 4 years ago

New PR: https://github.com/pickware/shopware-platform-private/pull/10