Fix not-found pages issue (#12370)#12424
Conversation
|
Too many files changed? Review this PR in Change Stack to see how the pieces fit before you dive in. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughFour middleware files across BlazorUI Demo and website projects update HTTP error-page handling to defer status code assignment to ChangesHTTP Status Code Deferred Assignment
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 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 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 |
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #12370 where navigating to /not-found on bitplatform.dev caused an exception instead of rendering the expected 404 UI, by deferring 404/401/403 status code assignment until the response is starting (so Blazor can render and flush the page body normally).
Changes:
- Defer setting the
/not-foundHTTP 404 status code viaHttpResponse.OnStartingin the Sales, Platform, and Careers websites. - Defer setting
/not-found(404) and/not-authorized(401/403) status codes viaOnStartingin the BlazorUI Demo server, with an added inline explanation of the underlying Blazor/StatusCodePages interaction.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Websites/Sales/src/Bit.Websites.Sales.Server/Startup/Middlewares.cs | Defers /not-found status code to response start to avoid interfering with Blazor rendering / status-code handling. |
| src/Websites/Platform/src/Bit.Websites.Platform.Server/Startup/Middlewares.cs | Same deferred 404 approach for the Platform site (the site affected by #12370). |
| src/Websites/Careers/src/Bit.Websites.Careers.Server/Startup/Middlewares.cs | Aligns Careers site behavior by deferring the 404 status code for /not-found. |
| src/BlazorUI/Demo/Bit.BlazorUI.Demo.Server/Startup/Middlewares.cs | Defers 404/401/403 status codes for not-found/not-authorized pages and documents the rationale tied to enhanced navigation headers. |
closes #12370
Summary by CodeRabbit