Jiseoup/showmycodePublic
EN|KO
  • 코드
  • 커밋
  • 풀 리퀘스트
← 목록으로

fix: validate PR number param and use i18n for repo visibility badge

JiseoupJiseoup · 2026년 6월 13일77211a7

변경된 파일2개+3 -1

변경된 파일

+3 -1 · 2개

@@ -1,3 +1,4 @@
+import { notFound } from "next/navigation";
import Link from "next/link";
import Image from "next/image";
import { getPull, getPullFiles, getPullCommits } from "@/lib/github";
@@ -45,6 +46,7 @@ export default async function PullDetailPage({ params, searchParams }: Props) {
const { lang, owner, repo, number } = await params;
const { tab: tabParam } = await searchParams;
const prNumber = parseInt(number, 10);
+ if (isNaN(prNumber)) notFound();
const tab: Tab = tabParam === "commits" ? "commits" : tabParam === "files" ? "files" : "overview";
@@ -88,7 +88,7 @@ export function RepoCard({
{/* Private/Public badge. */}
<span className="border-border text-muted-foreground shrink-0 rounded-full border px-2 py-0.5 text-xs">
- {repo.private ? "Private" : "Public"}
+ {repo.private ? dict.private : dict.public}
</span>
</div>
</Link>