magento / pwa-studio

🛠Development tools to build, optimize and deploy Progressive Web Applications for Magento 2.
https://developer.adobe.com/commerce/pwa-studio/
Open Software License 3.0
1.06k stars 683 forks source link

[Issue] [FEATURE] Added the xfwd option to the proxyMiddleware so HTTP_X_FORW… #3031

Closed m2-assistant[bot] closed 3 years ago

m2-assistant[bot] commented 3 years ago

This issue is automatically created based on existing pull request: magento/pwa-studio#2986: <FEATURE] Added the xfwd option to the proxyMiddleware so HTTPXFORW…

…ARDED_HOST can be used to determine the store

[!-- Before submitting this pull request, please make sure you have read our Contribution Guidelines and your PR meets our contribution standards: https://github.com/magento/pwa-studio/blob/master/.github/CONTRIBUTING.md

Please fill out as much information as you can about your PR to help speed up the review process. If your PR addresses an existing GitHub Issue, please refer to it in the title or Additional Information section to make the connection.

We may ask you for changes in your PR in order to meet the standards set in our Contribution Guidelines. PRs that do not comply with our guidelines may be closed at the maintainers' discretion.

Feel free to remove this section before creating this PR. Thank you for your contribution! --]

Description

When you allow a Magento Route through the Venia proxy there is no possible way to determine the current store. By enabling the xfwd option in the proxyMiddleware it is possible to allow Magento to determine the current store based on HTTPX_FORWARDEDHOST.

For example when you have a Magento Module which generates a PDF file with product data it should also have the store information to display the correct language and storeview values of the product.

  'HTTP*X_FORWARDED*FOR' => '127.0.0.1',
  'HTTP*X_FORWARDED*PORT' => '8227',
  'HTTP*X_FORWARDED*PROTO' => 'https',
  'HTTP*X_FORWARDED*HOST' => 'pwa-studio-xelbq.local.pwadev:8227',

Checklist

[!--- Go over all the following points, and make sure you've done anything necessary -->

Test Plan: (provided by contributor)

sirugh commented 3 years ago

@magento export issue to JIRA project PWA as Story

github-jira-sync-bot commented 3 years ago

:white_check_mark: Jira issue (https://jira.corp.magento.com/browse/PWA-1485) is successfully created for this issue.