CodeIssuesPull RequestsActionsSecurityInsights
✨ AI
More
Settings

Consolidate and clean up middleware configuration #4684

Open⚡ AI-generatedXLccantynz wants to mergeclaude/fix-dominic-500-error-8qLL6main↑4 ↓9opened Mar 19, 20262/5 tasksLive: 0 editing
ccantynzcommented Mar 19, 2026

Originally written by @ccantynz-alt on GitHub.
Imported from https://github.com/ccantynz-alt/Dominat8.com/pull/18


What changed?

  • Refactor
  • Infra / CI

Summary

Consolidated middleware logic from src/middleware.ts into the root middleware.ts file and cleaned up the implementation:

Key changes:

  • Removed duplicate src/middleware.ts file (consolidated into root middleware.ts)
  • Simplified pathname extraction and variable naming for clarity
  • Reorganized middleware logic into clear sections: auth-check bypass → legacy probe/ping redirects → API routes → default routes
  • Expanded matcher config to properly cover all routes that need middleware processing
  • Removed debug/timestamp headers (x-dominat8-mw-hit, x-dominat8-mw-path) and cleaned up comments
  • Enhanced anti-cache headers for non-API routes with Surrogate-Control header
  • Improved code readability with consistent formatting and logical flow

Quality gates

  • CI build is green
  • No unexpected UI/design changes on Dominat8.com
  • If protected paths changed: override label OR ALLOW_PROTECTED_PATHS file added with reason

Notes / risks

  • Middleware behavior is functionally equivalent to the previous implementation
  • The matcher config now explicitly covers both API and non-API routes, ensuring consistent middleware application
  • Legacy probe/ping endpoints continue to redirect with 307 status and appropriate headers
  • Auth-check endpoints remain bypassed as before

https://claude.ai/code/session_011r6wYP5rh2ktUty9Z6pKRT

ccantynzcommented Mar 19, 2026

Originally written by @vercel[bot] on GitHub.


The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dominat8com Ready Ready Preview, Comment Mar 20, 2026 0:47am

Request Review

gluecron[bot]🤖 botcommented 25d ago

This PR has gone quiet

No activity for 7+ days. Is this still in progress?

  • Author: keep working / mark draft / close.
  • Reviewers: review or unassign yourself.
  • Maintainers: close if no longer relevant.
gluecron[bot]🤖 botcommented 18d ago

This PR has gone quiet

No activity for 7+ days. Is this still in progress?

  • Author: keep working / mark draft / close.
  • Reviewers: review or unassign yourself.
  • Maintainers: close if no longer relevant.
gluecron[bot]🤖 botcommented 11d ago

This PR has gone quiet

No activity for 7+ days. Is this still in progress?

  • Author: keep working / mark draft / close.
  • Reviewers: review or unassign yourself.
  • Maintainers: close if no longer relevant.
gluecron[bot]🤖 botcommented 4d ago

This PR has gone quiet

No activity for 7+ days. Is this still in progress?

  • Author: keep working / mark draft / close.
  • Reviewers: review or unassign yourself.
  • Maintainers: close if no longer relevant.

Files changed

Side-by-side diff for claude/fix-dominic-500-error-8qLL6 → main.

View diff →

Cross-repo impact

See what breaks downstream if this PR merges.

Analyze →
Risk score: LOW (2/10)c2d4fc2
Touches 2 file(s) with 5 added and 1 removed across 0 owner(s). Includes a new dependency. No tests were added for the new code.
See full signal breakdown
  • files changed: 2
  • lines added/removed: 5 / 1
  • distinct owners touched: 0
  • schema migration touched: no
  • locked / sensitive path touched: no
  • adds new dependency: yes
  • bumps major dependency: no
  • tests added for new code: no
  • diff-minus-test ratio: 1.00
How is this calculated? The score is a transparent sum of weighted signals — see src/lib/pr-risk.ts computePrRiskScore.

Gate checks

1 of 6 failing
GateTestDisabled in settingsSkipped
Secret scanNo secrets detectedPassed
Security scanStatic rules ran (8 checks, no AI required) — no static findings. AI review unavailable: The platform's AI balance is exhausted, so AI generation is temporarily unavailable. Nothing was lost. You can queue this as a repair for the internal agent from the repository's Health page, or try again once the balance is restored.Skipped
Merge checkMerge conflicts detected — AI auto-resolution will be attempted on mergeFailing
CINo CI workflows are configured for this repositorySkipped
AI ReviewAIAI review approvedPassed

Resolve conflicts manually

GlueCron AI will attempt auto-resolution when you press Merge. If it cannot, or you would rather not wait on it, the manual path below always works.
12 conflicting files between claude/fix-dominic-500-error-8qLL6 and main:
  • .github/ALLOW_PROTECTED_PATHS
  • middleware.ts
  • package-lock.json
  • src/app/(marketing)/_d8/D8Bits.tsx
  • src/app/_client/D8TV.tsx
  • src/app/admin/marketing-queue/page.tsx
  • src/app/api/__probe__/route.ts
  • src/app/page.tsx
  • src/app/video/_client/VideoStudioClient.tsx
  • src/lib/d8kv.ts
  • src/lib/kv.ts
  • tsconfig.json
git fetch origin
git checkout claude/fix-dominic-500-error-8qLL6
git merge origin/main      # fix the files listed above, then:
git add -A && git commit
git push origin claude/fix-dominic-500-error-8qLL6
After you push, the merge check re-runs automatically on the next page load and the Merge button unblocks once it passes.
c comment · e edit title · m merge · a approve · r request changes · ? shortcuts