Summary

hyde: support trailing slashes on directories

Metadata

Attachments

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.

Changes and comments

[2012-01-19 03:32:07 UTC] retroj attached hyde-trailing-slashes-fix-1.patch (description=patch to page-by-path fixing trailing-slashes handling)

[2012-04-16 15:16:36 UTC] felix removed milestone 4.8.0

[2016-08-25 20:58:20 UTC] sjamaan set difficulty to trivial

[2023-11-06 21:59:31 UTC] felix set milestone to someday