Opened 12 years ago

Last modified 5 months ago

#779 new defect

hyde: support trailing slashes on directories

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

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.

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 (4)

Changed 12 years ago by John Foerch

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

comment:1 Changed 12 years ago by felix winkelmann

Milestone: 4.8.0

comment:2 Changed 8 years ago by sjamaan

Estimated difficulty: trivial

comment:3 Changed 5 months ago by felix winkelmann

Milestone: someday
Note: See TracTickets for help on using tickets.