> I have noticed something odd though. I created a directory which when
> served by lighttpd in Firefox looks like:
> 
>     Index of /test/
>     ../               -       Directory
>     This is just a test.mkv/  2024-Mar-03 13:22:24    583.7M  video/x-matroska
>     This is just a test.txt/  2024-Mar-03 13:05:21    0.1K    
> text/plain;charset=utf-8

There is a regression in lighttpd 1.4.74 and will be fixed in lighttpd
1.4.75 released later this month (Mar).  The regression causes the
display of filenames in mod_dirlisting to end in '/'.

https://redmine.lighttpd.net/issues/3242

> In Firefox, if I click on the text file it works just as expected and FF shows
> the contents of the text file.
> 
> For the video file however it starts a download, but renames the file to
> `6GQOZxf0.mpv` (an MS-DOS like 8.3 filename).
> 
> If I use wget to retrieve the file I get this:
> 
>     > wget -S http://white:8080/test/This%20is%20just%20a%20test.mkv/
>     --2024-03-03 13:38:41--  
> http://white:8080/test/This%20is%20just%20a%20test.mkv/
>     Resolving white (white)... 192.168.1.8
>     Connecting to white (white)|192.168.1.8|:8080... connected.
>     HTTP request sent, awaiting response... 
>       HTTP/1.1 200 OK
>       Content-Type: video/x-matroska
>       ETag: "72386044"
>       Last-Modified: Sun, 03 Mar 2024 02:22:24 GMT
>       Content-Length: 612101519
>       Accept-Ranges: bytes
>       Date: Sun, 03 Mar 2024 02:38:41 GMT
>       Server: lighttpd/1.4.74
>     Length: 612101519 (584M) [video/x-matroska]
>     Saving to: ‘index.html.1’
> 
> However, if I drop the trailing `/` from the filename it works as expected:
> 
> 
>     > wget -S http://white:8080/test/This%20is%20just%20a%20test.mkv
>     --2024-03-03 13:40:38--  
> http://white:8080/test/This%20is%20just%20a%20test.mkv
>     Resolving white (white)... 192.168.1.8
>     Connecting to white (white)|192.168.1.8|:8080... connected.
>     HTTP request sent, awaiting response... 
>       HTTP/1.1 200 OK
>       Content-Type: video/x-matroska
>       ETag: "72386044"
>       Last-Modified: Sun, 03 Mar 2024 02:22:24 GMT
>       Content-Length: 612101519
>       Accept-Ranges: bytes
>       Date: Sun, 03 Mar 2024 02:40:38 GMT
>       Server: lighttpd/1.4.74
>     Length: 612101519 (584M) [video/x-matroska]
>     Saving to: ‘This is just a test.mkv’
> 
> My guess is that that problem is in the module that generates the listing
> for a directory and that the problem is that it puts a trailing `/` on 
> file as well as just directories.
> 
> I use lighttpd to serve viedo files for a kodi.tv box, so I cannot maually
> correct the generated directory listings that lighttpd gives me.

Ok, so it sounds to me like the client is renaming the downloaded file,
not lighttpd, due to the bug in lighttpd 1.4.74 mod_dirlisting
erroneously adding a trailing '/' to the filename.

This will be fixed in the next version of lighttpd, and I'll probably
submit a patch to Debian sooner.

Cheers, Glenn

Reply via email to