Skip to content

Fix public legal redirect behind reverse proxy#32

Merged
r-yalcin merged 1 commit into
mainfrom
codex/fix-legal-redirect-20260713
Jul 13, 2026
Merged

Fix public legal redirect behind reverse proxy#32
r-yalcin merged 1 commit into
mainfrom
codex/fix-legal-redirect-20260713

Conversation

@r-yalcin

Copy link
Copy Markdown
Collaborator

Änderung

  • verwendet die konfigurierte öffentliche Basis-URL für /legal
  • verhindert Weiterleitungen auf die interne Container-Adresse hinter Cloudflare Tunnel/Traefik

Prüfung

  • 11 Tests erfolgreich
  • TypeScript-Prüfung erfolgreich
  • produktive Ziel-URL ist als NEXT_PUBLIC_BASE_URL konfiguriert

Copilot AI review requested due to automatic review settings July 13, 2026 11:54
@r-yalcin
r-yalcin merged commit 49a4dfb into main Jul 13, 2026
2 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the /legal route handler to build redirects using a configured public base URL, avoiding redirects to internal container addresses when running behind a reverse proxy (e.g., Cloudflare Tunnel/Traefik).

Changes:

  • Use NEXT_PUBLIC_BASE_URL as the base for the /legal redirect.
  • Preserve existing behavior by falling back to request.url when the env var is not set.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/app/legal/route.ts
Comment on lines +4 to +5
const baseUrl = process.env.NEXT_PUBLIC_BASE_URL ?? request.url;
return NextResponse.redirect(new URL("/legal/impressum", baseUrl), 307);
@r-yalcin
r-yalcin deleted the codex/fix-legal-redirect-20260713 branch July 14, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants