Add workaround for hostname of events api link

addresses #1465
This commit is contained in:
Sylvain Bellemare 2017-05-11 16:13:05 +02:00 committed by Sylvain Bellemare
parent f3cd43e5a9
commit 9d3eb23abf

View File

@ -28,4 +28,7 @@ def base_url():
def base_ws_uri():
"""Base websocket uri."""
return 'ws://{host}:{port}'.format(**config['wsserver'])
# TODO Revisit as this is a workaround to address issue
# https://github.com/bigchaindb/bigchaindb/issues/1465.
host = request.environ['HTTP_HOST'].split(':')[0]
return 'ws://{}:{}'.format(host, config['wsserver']['port'])