Summary
hyde: support trailing slashes on directories
Metadata
- Id: b2ab7baef7f14b9245ed35d1371ff9dee3c6cb8e
- Trac id: 779
- Type: defect
- Reporter: retroj
- Owner:
- Cc:
- Status: new
- Component: extensions
- Estimated difficulty: trivial
- Resolution:
- Priority: major
- Milestone: someday
- Version: 4.7.x
- Changetime: 2023-11-06 21:59:31 UTC
- Created: 2012-01-19 03:31:25 UTC
- Keywords:
Attachments
- b2ab7baef7f14b9245ed35d1371ff9dee3c6cb8e/attachments/hyde-trailing-slashes-fix-1.patch
Description
hyde serve (hyde 0.15) fails to serve index content when the request url has a trailing slash on the end of the directory. For example, make a hyde project with a file like the following in the src/ dir:
about/index.wiki
Run hyde serve and try the following urls:
http://localhost:8080/about/index.html → OK http://localhost:8080/about → OK http://localhost:8080/about/ → FAIL
The problem is in the procedure 'page-by-path', which is called by 'serve' to find the page object for the given uri path. In the case where the directory has a trailing slash, the path object (a list that was returned by 'uri-path') has as its last term an empty string, and page-by-path fails to deal with this.
A patch showing one way to fix this is attached.