Skip to content

Commit

Permalink
Revert C locale setting in websocketproxy.py
Browse files Browse the repository at this point in the history
This reverts commit cc56f7b.
  • Loading branch information
Giuseppe Corbelli committed Apr 4, 2019
1 parent 1a7481b commit ba196d2
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions websockify/websocketproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
'''

import signal, socket, optparse, time, os, sys, subprocess, logging, errno, ssl
import locale
try:
from socketserver import ThreadingMixIn
except ImportError:
Expand Down Expand Up @@ -47,15 +46,15 @@ class ProxyRequestHandler(websockifyserver.WebSockifyRequestHandler):
< - Client send
<. - Client send partial
"""

def send_auth_error(self, ex):
self.send_response(ex.code, ex.msg)
self.send_header('Content-Type', 'text/html')
for name, val in ex.headers.items():
self.send_header(name, val)

self.end_headers()

def validate_connection(self):
if not self.server.token_plugin:
return
Expand Down Expand Up @@ -84,7 +83,7 @@ def auth_connection(self):
except (TypeError, AttributeError, KeyError):
# not a SSL connection or client presented no certificate with valid data
pass

try:
self.server.auth_plugin.authenticate(
headers=self.headers, target_host=self.server.target_host,
Expand Down Expand Up @@ -434,7 +433,7 @@ def select_ssl_version(version):
# It so happens that version names sorted lexicographically form a list
# from the least to the most secure
keys = list(SSL_OPTIONS.keys())
keys.sort()
keys.sort()
fallback = keys[-1]
logger = logging.getLogger(WebSocketProxy.log_prefix)
logger.warn("TLS version %s unsupported. Falling back to %s",
Expand All @@ -443,9 +442,6 @@ def select_ssl_version(version):
return SSL_OPTIONS[fallback]

def websockify_init():
# Get an unified locale so that we can avoid shipping tons of locales
# if we build a frozen distribution
locale.setlocale(locale.LC_ALL, 'C')
# Setup basic logging to stderr.
logger = logging.getLogger(WebSocketProxy.log_prefix)
logger.propagate = False
Expand Down

0 comments on commit ba196d2

Please sign in to comment.