aminoacid Well-Known Member Licensed User Longtime User Oct 13, 2023 #1 Is there any way to prevent jServer from listing the files in the subdirectories that may exist in the home directory? For example if you create a websockets server running on port 80 that has a sub-directory called "css", the following URL will list all the files in the "css" subdirectory: http://IPADDRESS/css This may not be desirable. Most web servers have an option to turn this off. I'm sure Jetty does too, but could not final any info on this forum on how to do it. Thanks!
Is there any way to prevent jServer from listing the files in the subdirectories that may exist in the home directory? For example if you create a websockets server running on port 80 that has a sub-directory called "css", the following URL will list all the files in the "css" subdirectory: http://IPADDRESS/css This may not be desirable. Most web servers have an option to turn this off. I'm sure Jetty does too, but could not final any info on this forum on how to do it. Thanks!
EnriqueGonzalez Expert Licensed User Longtime User Oct 13, 2023 #2 yes add this line before server.start server.SetStaticFilesOptions(CreateMap("dirAllowed": False)) Upvote 1
aminoacid Well-Known Member Licensed User Longtime User Oct 13, 2023 #3 EnriqueGonzalez said: yes add this line before server.start server.SetStaticFilesOptions(CreateMap("dirAllowed": False)) Click to expand... Works like a charm. Thank you! Upvote 0
EnriqueGonzalez said: yes add this line before server.start server.SetStaticFilesOptions(CreateMap("dirAllowed": False)) Click to expand... Works like a charm. Thank you!