Skip to content

feat(links): redirect public short links to their destinations - #46

Draft
brennenho wants to merge 1 commit into
brennen/demo-mainfrom
brennen/demo-ctc-40
Draft

brennenho wants to merge 1 commit into
brennen/demo-mainfrom
brennen/demo-ctc-40

Conversation

@brennenho

Copy link
Copy Markdown
Contributor

Summary

Anyone with a saved short link can follow it at /s/[code] without signing in. The existing JSON link lookup still requires a session. Implements CTC-40.

Changes

  • Look up only the destination URL in the existing D1 table and return an HTTP 302 redirect.
  • Return a readable 404 for invalid or unknown codes and document the public route.

Testing

  • pnpm check passed formatting, lint, type checking, and all 100 tests.
  • Applied migrations locally, seeded one link in D1, and sent four requests to the running app without cookies.
Request Observed result
GET /s/ctc40-demo 302 with Location: https://example.org/signup?event=fall#agenda
GET /s/ctc40-missing 404 with “Short link not found” and no Location header
GET /s/x! 404 with the same message and no Location header
GET /api/links/ctc40-demo 401 with “Sign in first.”

@linear-code

linear-code Bot commented Nov 19, 2026

Copy link
Copy Markdown

CTC-40

@github-actions

Copy link
Copy Markdown

Preview deployment

Open preview ↗

Last deployed 2026-11-19T04:16:57Z

Commit Workflow
c3c66ae Run #73 · attempt 1

Fallback preview

This branch was successfully deployed

1 active deployment
pr-46 — c3c66ae1 Deployed Nov 19, 2026 by github-actions[bot]
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