Commit 4e0331b
fix: preserve partial search param through redirects (#3715)
## Summary
- Fixes #2610 — "Partial + redirect breaks islands"
- When a partial request (`?fresh-partial=true`) hits a server-side
redirect via `ctx.redirect()`, the `fresh-partial` search param is now
preserved in the redirect `Location` header
- Previously the param was lost, so the redirect target rendered as a
full page instead of a partial response, breaking island hydration
The fix is in `ctx.redirect()` in `packages/fresh/src/context.ts` — when
`this.isPartial` is true, the partial param is appended to the redirect
location (handling existing query params and hash fragments correctly).
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 0015710 commit 4e0331b
2 files changed
Lines changed: 48 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
185 | 195 | | |
186 | 196 | | |
187 | 197 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
73 | 111 | | |
74 | 112 | | |
75 | 113 | | |
| |||
0 commit comments