Opened 12 years ago

Last modified 7 years ago

#779 new defect

hyde: support trailing slashes on directories

Reported by: John Foerch Owned by:
Priority: major Milestone:
Component: extensions Version: 4.7.x
Keywords: Cc:
Estimated difficulty: trivial


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:


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.

Attachments (1)

hyde-trailing-slashes-fix-1.patch (460 bytes) - added by John Foerch 12 years ago.
patch to page-by-path fixing trailing-slashes handling

Download all attachments as: .zip

Change History (3)

Changed 12 years ago by John Foerch

patch to page-by-path fixing trailing-slashes handling

comment:1 Changed 11 years ago by felix winkelmann

Milestone: 4.8.0

comment:2 Changed 7 years ago by sjamaan

Estimated difficulty: trivial
Note: See TracTickets for help on using tickets.