Restore functionaltiy to file_only

There was a bug in WebSocketServer that prevented the `file_only`
parameter from actually being set as an instance property, causing
directory listings to appear even with `file_only=True`.  This
commit fixes that.

See-Also: https://bugs.launchpad.net/nova/+bug/1447675

Conflicts:
	websockify/websocket.py
This commit is contained in:
Solly Ross 2015-05-11 10:24:38 -04:00
parent 739af6ecb4
commit d626fed76a
1 changed files with 6 additions and 2 deletions

View File

@ -581,7 +581,8 @@ class WebSocketServer(object):
self.timeout = timeout
self.idle_timeout = idle_timeout
self.traffic = traffic
self.file_only = file_only
self.launch_time = time.time()
self.ws_connection = False
self.handler_id = 1
@ -618,7 +619,10 @@ class WebSocketServer(object):
self.listen_host, self.listen_port)
self.msg(" - Flash security policy server")
if self.web:
self.msg(" - Web server. Web root: %s", self.web)
if self.file_only:
self.msg(" - Web server (no directory listings). Web root: %s", self.web)
else:
self.msg(" - Web server. Web root: %s", self.web)
if ssl:
if os.path.exists(self.cert):
self.msg(" - SSL/TLS support")