Description of the bug
When listing files in directories using the HtmlDirectoryListener the URLs for the files end in a slash.
This causes issues with some tools such as wget which will download the file and save it as index.html instead of the name of the files.
To Reproduce
Steps to reproduce the behavior:
In a directory (/temp) put some files
Create a server using the following code
WebServer server = new WebServer(HttpListenerMode.EmbedIO, "http://*:8080"); server.WithLocalSessionManager(); server.WithModule(new EmbedIO.Files.FileModule("/", new EmbedIO.Files.FileSystemProvider(Path.GetFullPath(Path.Combine("/", "temp")), false)) { DirectoryLister = EmbedIO.Files.DirectoryLister.Html, }); server.RunAsync();
Open the servers web page in a web browser
Examine the URLs for the files that are listed in the directory
Expected behavior
The URLs for listed files should not end with a slash.
Screenshots
Chrome browser from Windows
Chrome on Android
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Description of the bug When listing files in directories using the HtmlDirectoryListener the URLs for the files end in a slash. This causes issues with some tools such as wget which will download the file and save it as index.html instead of the name of the files.
To Reproduce Steps to reproduce the behavior:
WebServer server = new WebServer(HttpListenerMode.EmbedIO, "http://*:8080"); server.WithLocalSessionManager(); server.WithModule(new EmbedIO.Files.FileModule("/", new EmbedIO.Files.FileSystemProvider(Path.GetFullPath(Path.Combine("/", "temp")), false)) { DirectoryLister = EmbedIO.Files.DirectoryLister.Html, }); server.RunAsync();
Expected behavior The URLs for listed files should not end with a slash.
Screenshots Chrome browser from Windows Chrome on Android
Desktop:
Smartphone:
Additional context Pull request: https://github.com/unosquare/embedio/pull/503