Skip to content

fix default extension files shadowed by same-name directories - #978

Open
kisnner26 wants to merge 1 commit into
http-party:masterfrom
kisnner26:fix/default-extension-directory-collision
Open

kisnner26 wants to merge 1 commit into
http-party:masterfrom
kisnner26:fix/default-extension-directory-collision

Conversation

@kisnner26

Copy link
Copy Markdown

when users.html and a users/ directory coexist, /users always redirects to the directory, making the extensionless page unreachable. try a readable sibling file with the configured default extension before handling an extensionless directory request.

/users/ continues to address the directory explicitly. if there is no matching sibling file, keep directory redirects and listings. carry the request method and query string into the file lookup.

fixes #629.

validation: npm test passes all 547 assertions across 43 suites on macos with node 26. regression coverage includes the collision, query strings, explicit directory access, child pages, missing sibling files, a custom extension and head. the collision cases fail before the fix. git diff --check passes.

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.

Serve file with default ext is same name dir cannot be shown

1 participant