[codex] fix 5chan hash redirect behind daemon#61
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR refines the script removal logic in the daemon webui HTML generation. A new ChangesRoot-hash redirect script removal
🎯 2 (Simple) | ⏱️ ~8 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
src/webui/daemon-server.tsOops! Something went wrong! :( ESLint: 8.27.0 Error: ESLint configuration in --config » eslint-config-oclif is invalid:
Referenced from: /.eslintrc test/cli/daemon.test.tsOops! Something went wrong! :( ESLint: 8.27.0 Error: ESLint configuration in --config » eslint-config-oclif is invalid:
Referenced from: /.eslintrc 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 |
Summary
window.location.replace('/#' + window.location.pathname + window.location.search)call instead of relying on the old comment text.Root Cause
5chan v0.8.5 changed the surrounding normalization-script comment, so the existing CLI regex no longer removed the script. Behind the daemon, that script can navigate to
/#..., which targets the Express root instead of the auth-key web UI route.Validation
npm run buildnpm run build:testnpm run ci:download-web-uisnpx vitest run --config config/vitest.config.ts test/cli/daemon.test.ts -t "5chan webui does not contain the root hash redirect script"Note
Low Risk
Localized change to HTML preprocessing and a CLI test; no auth, RPC, or data-path behavior changes.
Overview
Fixes 5chan being served behind the daemon with an inline root hash redirect still present after a web UI update changed the script’s comment text, so the old strip regex no longer matched.
daemon-server.tsnow removes the whole<script>block by matching the actualwindow.location.replace('/#' + pathname + search)call instead of the obsolete “Redirect non-hash URLs” comment. The daemon web UI test was updated to assert that redirect snippet is absent from served HTML.Reviewed by Cursor Bugbot for commit 82b53fc. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit