Skip to content

Adds oembed redirect and a home for more redirects#1319

Merged
eyeseast merged 2 commits into
mainfrom
oembed-redirect
Apr 21, 2026
Merged

Adds oembed redirect and a home for more redirects#1319
eyeseast merged 2 commits into
mainfrom
oembed-redirect

Conversation

@eyeseast
Copy link
Copy Markdown
Collaborator

@eyeseast eyeseast commented Apr 15, 2026

I saw 404s on /api/oembed.json/, so this ensures we normalize the URL and redirect correctly. Once this merges, we can remove the version in the CF dashboard.

I also added a (redirects) directory so these stay in one place and don't clutter up other routes. The /app redirect is there now.

@github-actions
Copy link
Copy Markdown

Preview deployed: https://preview-1319.staging.documentcloud.org

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 15, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 58.57% 2380 / 4063
🔵 Statements 59.17% 2756 / 4657
🔵 Functions 60.52% 621 / 1026
🔵 Branches 59.34% 1460 / 2460
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/routes/(redirects)/api/oembed.json/+server.ts 0% 100% 0% 0% 4-11
Generated in workflow #1200 for commit 9797080 by the Vitest Coverage Report Action

@duckduckgrayduck
Copy link
Copy Markdown
Contributor

I've confirmed that

  • /app and /app/ redirect to /documents/
  • /api/oembed.json/ redirects to /api/oembed/

I can't seem to test if /api/oembed.json with a URL parameter redirects or not, because the front-end assets are a different link than the documents on the backend

@eyeseast
Copy link
Copy Markdown
Collaborator Author

I confirmed that this forwards query params: https://preview-1319.staging.documentcloud.org/api/oembed.json?url=https://preview-1319.staging.documentcloud.org/documents/20011330-pioservices/

The staging server doesn't recognize the domain, so it 404s, but that's fine.

@duckduckgrayduck
Copy link
Copy Markdown
Contributor

Yea, that's basically what I was getting at, otherwise looks good

@eyeseast eyeseast merged commit d35abd9 into main Apr 21, 2026
7 of 8 checks passed
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