Skip to content

Answer 404 for unknown pastes and add robots.txt - #38

Merged
Musiker15 merged 1 commit into
mainfrom
fix/robots-and-unknown-paste-404
Nov 24, 2026
Merged

Musiker15 merged 1 commit into
mainfrom
fix/robots-and-unknown-paste-404

Conversation

@Musiker15

Copy link
Copy Markdown
Member

Found in a crawl of msk-scripts.de with OpenSpider: https://paste.msk-scripts.de/robots.txt answered 200 with an HTML page titled "Paste robots.txt".

  • app/[id]/page.tsx: an unknown ID now calls notFound(). Before, the page rendered the not-found panel itself, so the status stayed 200 for every unknown ID. app/not-found.tsx shows the same panel, now with a 404.
  • app/robots.ts: allows /, blocks /api/, /raw/ and /dl/.

Expired and burned pastes still render their panel with 200. They were real pages once, and changing that is a separate decision.

Typecheck and lint pass locally. The 404 needs the database, so it gets checked live after the deploy.

An unknown paste ID rendered the not-found panel with status 200. That
made /robots.txt a paste page titled "Paste robots.txt", and every
mistyped link looked like a real page to a crawler. The route now calls
notFound(), and app/not-found.tsx shows the same panel with a 404.

robots.txt allows the site and blocks /api/, /raw/ and /dl/, which serve
the same content as the paste page.
@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@Musiker15
Musiker15 merged commit 3d4f732 into main Nov 24, 2026
8 checks passed
@Musiker15
Musiker15 deleted the fix/robots-and-unknown-paste-404 branch November 24, 2026 13:51
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.

1 participant