SalesforceCommerceCloud / pwa-kit

React-based JavaScript frontend framework to create a progressive web app (PWA) storefront for Salesforce B2C Commerce.
https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/pwa-kit-overview.html
BSD 3-Clause "New" or "Revised" License
276 stars 126 forks source link

Hide x-sfdc-access-control header #1805

Closed npeternel-sf closed 1 month ago

npeternel-sf commented 1 month ago

Hide the secret x-sfdc-access-control header value from the SSR server and proxied requests.

Description

MRT is releasing an origin lockdown feature that locks down the MRT origin only to authorized services (i.e. a stacked CDN). An incoming HTTP request will contain the header x-sfdc-access-control: <some-secret-value> that MRT will verify. To avoid this secret value from being leaked, this PR strips the header from the SSR origin server and proxied requests.

Types of Changes

Breaking changes include:

  • Removing a public function or component or prop
  • Adding a required argument to a function
  • Changing the data type of a function parameter or return value
  • Adding a new peer dependency to package.json

Changes

How to Test-Drive This PR

Checklists

General

Accessibility Compliance

You must check off all items in one of the follow two lists:

or...

Localization