Fix bug in token_plugin/target_cfg support

Previously, if no `target_cfg` flag was used, the `target_cfg` option
would not get removed from the opts dict, causing an error when it got
passed through to `WebSocketProxy`.  Now we always remove it.

Fixes #168.
This commit is contained in:
Solly Ross 2015-04-09 11:36:37 -04:00
parent ac9d357c87
commit 52c2e62535
1 changed files with 6 additions and 3 deletions

View File

@ -384,7 +384,8 @@ def websockify_init():
if opts.target_cfg:
opts.token_plugin = 'TokenFile'
opts.token_source = opts.target_cfg
del opts.target_cfg
del opts.target_cfg
# Sanity checks
if len(args) < 2 and not (opts.token_plugin or opts.unix_target):
@ -451,9 +452,11 @@ class LibProxyServer(ForkingMixIn, HTTPServer):
self.wrap_mode = kwargs.pop('wrap_mode', None)
self.unix_target = kwargs.pop('unix_target', None)
self.ssl_target = kwargs.pop('ssl_target', None)
self.target_cfg = kwargs.pop('target_cfg', None)
self.token_plugin = kwargs.pop('token_plugin', None)
self.token_source = kwargs.pop('token_source', None)
self.token_plugin = None
self.daemon = False
self.target_cfg = None
# Server configuration
listen_host = kwargs.pop('listen_host', '')