Skip to content

Commit

Permalink
Fix bug in token_plugin/target_cfg support
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
DirectXMan12 committed Apr 9, 2015
1 parent ac9d357 commit d64a9b2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions websockify/websocketproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -451,9 +452,10 @@ def __init__(self, RequestHandlerClass=ProxyRequestHandler, **kwargs):
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.daemon = False
self.target_cfg = None

# Server configuration
listen_host = kwargs.pop('listen_host', '')
Expand Down

0 comments on commit d64a9b2

Please sign in to comment.