Skip to content

[nextjs] The next-intl middleware does not work in composition with the Content SDK proxy.#536

Open
sc-naveenhedallaarachchi wants to merge 2 commits into
devfrom
bugfix/JSS-9604-short-circuit-on-proxy-redirect
Open

[nextjs] The next-intl middleware does not work in composition with the Content SDK proxy.#536
sc-naveenhedallaarachchi wants to merge 2 commits into
devfrom
bugfix/JSS-9604-short-circuit-on-proxy-redirect

Conversation

@sc-naveenhedallaarachchi

Copy link
Copy Markdown
Contributor

Description / Motivation

Fixes a bug in multi-language sites where redirects from an earlier handler in the Content SDK proxy chain were clobbered by downstream proxies.
defineProxy(...).exec(...) runs handlers (LocaleProxy, AppRouterMultisiteProxy, RedirectsProxy, PersonalizeProxy, etc.) sequentially against a shared NextResponse. When an upstream handler (e.g. next-intl) returned a redirect (307 to /en), later SDK proxies still ran and mutated the response (rewrites, headers, cookies), so the redirect was lost on the first hit.

  • This PR short-circuits the chain when the response is terminal: 403, redirected, or an HTTP 3xx status code. Normal rewrite flows (200) are unchanged.

Testing Details

  • Unit Test Added
  • Manual Test/Other (Please elaborate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

@changeset-bot

changeset-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2a59f33

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sitecore-content-sdk/nextjs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

📦 Package Size and Test Coverage Report

Package Base Size PR Size Δ Change Base Coverage PR Coverage Δ Change
analytics-core 67.34 KB 67.34 KB ✅ 0.00 KB 97.40% 97.40% 0.00%
cli 61.06 KB 61.06 KB ✅ 0.00 KB 71.36% 71.36% 0.00%
content 432.99 KB 432.99 KB ✅ 0.00 KB 92.46% 92.46% 0.00%
core 120.61 KB 120.61 KB ✅ 0.00 KB 91.27% 91.27% 0.00%
create-content-sdk-app 535.55 KB 535.55 KB ✅ 0.00 KB 96.47% 96.47% 0.00%
events 72.27 KB 72.27 KB ✅ 0.00 KB 97.97% 97.97% 0.00%
nextjs 566.30 KB 566.79 KB 🔺 +0.49 KB 90.99% 91.01% +0.02%
personalize 64.01 KB 64.01 KB ✅ 0.00 KB 99.74% 99.74% 0.00%
react 232.23 KB 232.23 KB ✅ 0.00 KB 94.00% 94.00% 0.00%
search 8.10 KB 8.10 KB ✅ 0.00 KB 98.57% 98.57% 0.00%
Total 🔺 +0.49 KB

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.

1 participant