Mercurial > libervia-web
comparison libervia/server/server.py @ 1224:62bf4f87c249
server: some encoding fixes following python 3 port
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 06 Oct 2019 22:21:13 +0200 |
parents | c9fc839d304c |
children | f3edbca73713 |
comparison
equal
deleted
inserted
replaced
1223:4976eb0f5315 | 1224:62bf4f87c249 |
---|---|
1308 proxy_netloc = ( | 1308 proxy_netloc = ( |
1309 "{}:{}".format(proxy_server, proxy_port) | 1309 "{}:{}".format(proxy_server, proxy_port) |
1310 if proxy_port is not None | 1310 if proxy_port is not None |
1311 else proxy_server | 1311 else proxy_server |
1312 ) | 1312 ) |
1313 proxy_netloc = proxy_netloc.decode("utf-8") | |
1314 try: | 1313 try: |
1315 proxy_scheme = request.requestHeaders.getRawHeaders( | 1314 proxy_scheme = request.requestHeaders.getRawHeaders( |
1316 "x-forwarded-proto" | 1315 "x-forwarded-proto" |
1317 )[0].decode("utf-8") | 1316 )[0] |
1318 except TypeError: | 1317 except TypeError: |
1319 proxy_scheme = None | 1318 proxy_scheme = None |
1320 else: | 1319 else: |
1321 proxy_scheme, proxy_netloc = None, None | 1320 proxy_scheme, proxy_netloc = None, None |
1322 else: | 1321 else: |