Skip to content

fix(sites): serve /dir/index.html for extensionless paths in the router - #140

Merged
jamie-at-bunny merged 4 commits into
mainfrom
upgrade-sites-router
Jul 31, 2026
Merged

fix(sites): serve /dir/index.html for extensionless paths in the router#140
jamie-at-bunny merged 4 commits into
mainfrom
upgrade-sites-router

Conversation

@jamie-at-bunny

Copy link
Copy Markdown
Member

No description provided.

@bogdan-at-bunny

Copy link
Copy Markdown

@codex review

@changeset-bot

changeset-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3179860

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@bunny.net/cli Patch
@bunny.net/cli-linux-x64 Patch
@bunny.net/cli-linux-arm64 Patch
@bunny.net/cli-darwin-x64 Patch
@bunny.net/cli-darwin-arm64 Patch
@bunny.net/cli-windows-x64 Patch

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-apps

greptile-apps Bot commented Jul 31, 2026

Copy link
Copy Markdown

Greptile Summary

The router now preserves exact extensionless objects while resolving slashless directory paths through an index probe.

  • Adds an internal retry header for slashless GET and HEAD requests.
  • On an exact-path 404, probes the slash-terminated URL and redirects when its directory index exists.
  • Replaces mirrored test logic with helpers extracted from the shipped router source.
  • Adds a patch changeset and updates repository documentation.

Confidence Score: 5/5

The 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.

Important Files Changed

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
Loading

Reviews (3): Last reviewed commit: "fix directory paths" | Re-trigger Greptile

Comment thread packages/cli/src/commands/sites/router/source.ts Outdated
Comment thread packages/cli/src/commands/sites/router/source.test.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/cli/src/commands/sites/router/source.ts Outdated
@jamie-at-bunny
jamie-at-bunny merged commit f4b1486 into main Jul 31, 2026
2 checks passed
@jamie-at-bunny
jamie-at-bunny deleted the upgrade-sites-router branch July 31, 2026 15:11
@github-actions github-actions Bot mentioned this pull request Jul 31, 2026
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.

3 participants