Port no longer included in token when using --host-token
This commit is contained in:
parent
8cb89d2340
commit
d80c607cb6
|
@ -146,8 +146,15 @@ Traffic Legend:
|
||||||
# in the form of token: host:port
|
# in the form of token: host:port
|
||||||
|
|
||||||
if self.host_token:
|
if self.host_token:
|
||||||
|
# Use hostname as token
|
||||||
token = self.headers.get('Host')
|
token = self.headers.get('Host')
|
||||||
|
|
||||||
|
# Remove port from hostname, as it'll always be the one where
|
||||||
|
# websockify listens (unless something between the client and
|
||||||
|
# websockify is redirecting traffic, but that's beside the point)
|
||||||
|
if token:
|
||||||
|
token = token.partition(':')[0]
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Extract the token parameter from url
|
# Extract the token parameter from url
|
||||||
args = parse_qs(urlparse(self.path)[4]) # 4 is the query from url
|
args = parse_qs(urlparse(self.path)[4]) # 4 is the query from url
|
||||||
|
|
Loading…
Reference in New Issue