From da5109971cc9dbfc54991ce0165b4a68953b0190 Mon Sep 17 00:00:00 2001 From: rafa-be Date: Thu, 12 Sep 2024 16:27:59 +0200 Subject: [PATCH] Removes security warning when creating a server socket on 0.0.0.0. Signed-off-by: rafa-be --- scaler/about.py | 2 +- tests/utility.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scaler/about.py b/scaler/about.py index 2d986fc..320141d 100644 --- a/scaler/about.py +++ b/scaler/about.py @@ -1 +1 @@ -__version__ = "1.8.1" +__version__ = "1.8.2" diff --git a/tests/utility.py b/tests/utility.py index 39e8fb2..74d6d2f 100644 --- a/tests/utility.py +++ b/tests/utility.py @@ -1,7 +1,7 @@ import socket -def get_available_tcp_port() -> int: +def get_available_tcp_port(hostname: str = "127.0.0.1") -> int: with socket.socket(socket.AddressFamily.AF_INET, socket.SocketKind.SOCK_STREAM) as sock: - sock.bind(("0.0.0.0", 0)) + sock.bind((hostname, 0)) return sock.getsockname()[1]