Skip to content

fix: rewrite markdown doc requests internally instead of 303 redirect#808

Merged
tannerlinsley merged 1 commit intomainfrom
claude/fix-agent-doc-redirects-dVpOQ
Apr 4, 2026
Merged

fix: rewrite markdown doc requests internally instead of 303 redirect#808
tannerlinsley merged 1 commit intomainfrom
claude/fix-agent-doc-redirects-dVpOQ

Conversation

@tannerlinsley
Copy link
Copy Markdown
Member

@tannerlinsley tannerlinsley commented Apr 4, 2026

Agents requesting docs with Accept: text/markdown were getting 303
redirects to .md URLs, which many HTTP clients don't follow properly.
Instead of redirecting, internally rewrite the request to the .md route
and serve the markdown content directly.

https://claude.ai/code/session_01VBx5hnhWturAn1bBo68sCt

Summary by CodeRabbit

  • Refactor
    • Improved documentation request handling through internal optimization, enhancing efficiency when accessing documentation files.

Agents requesting docs with Accept: text/markdown were getting 303
redirects to .md URLs, which many HTTP clients don't follow properly.
Instead of redirecting, internally rewrite the request to the .md route
and serve the markdown content directly.

https://claude.ai/code/session_01VBx5hnhWturAn1bBo68sCt
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 4, 2026

Deploy Preview for tanstack ready!

Name Link
🔨 Latest commit 0eb48fc
🔍 Latest deploy log https://app.netlify.com/projects/tanstack/deploys/69d17c565c248d0008e2936b
😎 Deploy Preview https://deploy-preview-808--tanstack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 35
Accessibility: 90
Best Practices: 83
SEO: 97
PWA: 70
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 4, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 00f9070e-ab0c-41d3-bebb-51ff42aec3b6

📥 Commits

Reviewing files that changed from the base of the PR and between 202961c and 0eb48fc.

📒 Files selected for processing (1)
  • src/server.ts

📝 Walkthrough

Walkthrough

The code changes how non-.md requests to /docs/ are handled. Instead of sending an explicit 303 HTTP redirect with a Location header, the implementation now performs an internal rewrite by appending .md to the pathname, creating a new request, and forwarding it internally through the handler, logging the actual response status.

Changes

Cohort / File(s) Summary
Internal Rewrite Logic
src/server.ts
Replaced explicit 303 redirect for non-.md /docs/ requests with internal rewrite mechanism; appends .md to pathname, constructs new request, forwards to handler.fetch, and updates logging to report actual response status instead of fixed 303.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A docs path hops with grace,
No redirect's worn-out trace,
Internal rewrites save the day,
Let requests find their .md way! 📝

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/fix-agent-doc-redirects-dVpOQ

Comment @coderabbitai help to get the list of available commands and usage tips.

@tannerlinsley tannerlinsley merged commit 43fa62c into main Apr 4, 2026
6 of 8 checks passed
@tannerlinsley tannerlinsley deleted the claude/fix-agent-doc-redirects-dVpOQ branch April 4, 2026 21:02
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