How can I have unfiltered-jetty serve static files without allowing directory browsing?
Jetty has the dirAllowed setting, but it does not seem easily accessible from Unfiltered.
How can I have unfiltered-jetty serve static files without allowing directory browsing?
Jetty has the dirAllowed setting, but it does not seem easily accessible from Unfiltered.
This is not a full answer but I bet you can put it together by looking in 2 places:
1. the val unfiltered.jetty.Server.underlying of type org.eclipse.jetty.server.Server in the unfiltered-jetty code
2. 'Configuring a File Server' in the Jetty 8(i think) wiki. Maybe that resource_handler.setDirectoriesListed(true) call?
This is working with Unfiltered 0.8.4 which uses Jetty 8:
If
srv
is your Unfiltered server object after adding contexts to it, you can now disable directory browsing like so: