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:
parent
e450ecd1d5
commit
dbb1362fd2
@ -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', '')
|
||||
|
Loading…
Reference in New Issue
Block a user