Skip to content

@W-22283814 Forward x-sfdc-access-control header and preserve User-Agent in local dev proxy#426

Merged
kieran-sf merged 5 commits into
mainfrom
W-22283814-local-dev-ach-header-forwarding
May 14, 2026
Merged

@W-22283814 Forward x-sfdc-access-control header and preserve User-Agent in local dev proxy#426
kieran-sf merged 5 commits into
mainfrom
W-22283814-local-dev-ach-header-forwarding

Conversation

@kieran-sf
Copy link
Copy Markdown
Contributor

Summary

  • Conditionally forward the x-sfdc-access-control header to SCAPI proxy targets whose hostname matches a configured suffix list (default: .commercecloud.salesforce.com), mirroring the Lambda@Edge behavior from portal_app PR #7680
  • Preserve the original User-Agent header in non-caching proxy requests instead of overwriting it with Amazon CloudFront, mirroring portal_app PR #7712
  • Add hostnameMatchesTransformationList() utility for hostname suffix matching
  • Thread accessControlHeaderForwardingHostnames and preserveUserAgent params through the proxy call chain: createMRTProxyMiddlewaresconfigureProxyingconfigureProxyapplyProxyRequestHeadersrewriteProxyRequestHeaders

GUS: W-22283814

Test plan

  • All 534 tests pass (npm test in packages/mrt-utilities)
  • 100% line coverage on ssr-proxying.ts
  • Backward compatible — all params are optional with defaults matching prior behavior
  • Manual: run local dev server with SCAPI proxy, verify x-sfdc-access-control header is forwarded
  • Manual: verify real User-Agent is preserved in proxy requests to SCAPI

…gent in local dev proxy

Update the local dev proxy to conditionally forward the x-sfdc-access-control
header to SCAPI proxy targets whose hostname matches a configured suffix list,
mirroring the Lambda@Edge behavior from portal_app PRs 7680 and 7712. Also
preserve the original User-Agent header in non-caching proxy requests instead
of overwriting it with 'Amazon CloudFront'.
@kieran-sf kieran-sf requested a review from clavery as a code owner May 13, 2026 16:26
@kieran-sf kieran-sf merged commit 3779ebd into main May 14, 2026
5 checks passed
@kieran-sf kieran-sf deleted the W-22283814-local-dev-ach-header-forwarding branch May 14, 2026 18:01
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

Successfully merging this pull request may close these issues.

2 participants