🐛 Fixed admin toolbar redirect loops on subdirectory sites - #29838
Conversation
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run ghost:test:ci:integration |
✅ Succeeded | 2m 35s | View ↗ |
nx run ghost:test:integration |
✅ Succeeded | 2m 57s | View ↗ |
nx run ghost:test:legacy |
✅ Succeeded | 2m 54s | View ↗ |
nx run ghost:test:e2e |
✅ Succeeded | 2m 33s | View ↗ |
nx run @tryghost/admin:build |
✅ Succeeded | 1m 50s | View ↗ |
nx run ghost-monorepo:lint:boundaries |
✅ Succeeded | 23s | View ↗ |
nx run-many -t test:unit -p ghost |
✅ Succeeded | 30s | View ↗ |
nx run-many -t lint -p ghost,ghost-monorepo |
✅ Succeeded | 21s | View ↗ |
nx run-many --target=build --projects=tag:publi... |
✅ Succeeded | <1s | View ↗ |
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-08-10 18:31:37 UTC
Walkthrough
Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #29838 +/- ##
==========================================
- Coverage 75.45% 75.41% -0.04%
==========================================
Files 1605 1605
Lines 140458 140458
Branches 17424 17413 -11
==========================================
- Hits 105988 105933 -55
- Misses 33393 33477 +84
+ Partials 1077 1048 -29
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Reference PR: #29412 |

Activating the admin toolbar on a subdirectory site (e.g.
https://ghost.org/changelog/?admin=1) can redirect-loop when a reverse proxy strips the subdirectory before forwarding the request. Ghost then cleaned the query and redirected to/, which bounced back to the public URL withadmin=1still attached.Summary
urlUtils.createUrl()so the configured subdirectory is restored when missing (and left alone when already present)Test plan
pnpm test:single test/unit/frontend/web/middleware/admin-toolbar.test.js/?admin=1on a subdirectory install and confirm it redirects once to the public subdirectory path without looping