From 284353a99a9db6e7ac2110cb78cd300df408de31 Mon Sep 17 00:00:00 2001 From: Mathieu B Date: Sun, 1 Aug 2021 11:45:02 +0200 Subject: [PATCH] Replaced hostname by ip in request headers --- jarvis/utils/server_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jarvis/utils/server_utils.py b/jarvis/utils/server_utils.py index 988c391..8fedf69 100644 --- a/jarvis/utils/server_utils.py +++ b/jarvis/utils/server_utils.py @@ -15,7 +15,7 @@ def send_record_to_server(raw_audio_data): headers = CaseInsensitiveDict() headers["Content-Type"] = "text/xml; charset=utf8" - headers['Client-Ip'] = socket.gethostname() + headers['Client-Ip'] = socket.gethostbyname(socket.gethostname()) headers['Client-Port'] = str(config_utils.get_in_config('PORT')) # headers["Authorization"] = config_utils.get_in_config("API_KEY") @@ -23,7 +23,7 @@ def send_record_to_server(raw_audio_data): headers=headers, data=raw_audio_data) - print(response.content) + print(bytes.decode(response.content)) def get_server_port():