fix(sites): serve /dir/index.html for extensionless paths in the router - #140
Conversation
|
@codex review |
🦋 Changeset detectedLatest commit: 3179860 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Greptile SummaryThe router now preserves exact extensionless objects while resolving slashless directory paths through an index probe.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; the current code resolves exact extensionless objects before probing directory indexes, handles dotted directory segments without a filename heuristic, and the tests now execute helpers extracted from the shipped router source.
|
| Filename | Overview |
|---|---|
| packages/cli/src/commands/sites/router/source.ts | Replaces the dot-based path heuristic with exact-object-first directory probing, resolving both previously reported routing cases. |
| packages/cli/src/commands/sites/router/source.test.ts | Exercises helper implementations extracted from the shipped router source, eliminating the previously reported duplicated test logic. |
| .changeset/sites-router-extensionless-index.md | Records the router correction as a CLI patch release. |
| AGENTS.md | Documents the exact-lookup-first routing and slash-redirect behavior. |
Sequence Diagram
sequenceDiagram
participant Client
participant Router
participant Origin
Client->>Router: GET /blog
Router->>Origin: Exact deployment path
Origin-->>Router: 404
Router->>Origin: HEAD /blog/
Origin-->>Router: 200
Router-->>Client: 301 Location: /blog/
Client->>Router: GET /blog/
Router->>Origin: Deployment path/index.html
Origin-->>Router: Directory index
Router-->>Client: 200
Reviews (3): Last reviewed commit: "fix directory paths" | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8863e3053
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
No description provided.