hayajo / Mojolicious-Plugin-Directory

Other
6 stars 6 forks source link

Parent directory on listing for URL with no trailing / goes up two levels #5

Closed plicease closed 7 years ago

plicease commented 7 years ago

For example, if I do a GET on /foo/bar or /foo/bar/ I get this in the HTML listing:

  <tr><td class='name'><a href='../'>Parent Directory</a></td><td class='size'></td><td class='type'></td><td class='mtime'></td></tr>

Which is fine for the latter, but for the former /foo/ is the base url, and so ../ take me to / instead of /foo as you would expect.

I believe most webservers handing this by forwarding directory listings without a trailing slash to the same URL with a trailing slash.

hayajo commented 7 years ago

Sorry for being late. I fixed it in version 0.13.

https://metacpan.org/pod/release/HAYAJO/Mojolicious-Plugin-Directory-0.13/lib/Mojolicious/Plugin/Directory.pm

Thank you.