Skip to content

Commit

Permalink
Removes security warning when creating a server socket on 0.0.0.0. (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafa-be authored Sep 12, 2024
1 parent e6b9a56 commit 3159597
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scaler/about.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.8.1"
__version__ = "1.8.2"
4 changes: 2 additions & 2 deletions tests/utility.py
Original file line number Diff line number Diff line change
@@ -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]

0 comments on commit 3159597

Please sign in to comment.