From 5336316f4a8ad69a6acd4be5db8c15c94afa544a Mon Sep 17 00:00:00 2001 From: Swastik Date: Tue, 9 Jul 2024 17:47:25 +0530 Subject: [PATCH] net.tcp: fix peer_ip to only return the ip address --- vlib/net/tcp.c.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vlib/net/tcp.c.v b/vlib/net/tcp.c.v index 3a265ef1ed70e3..da957d6aa4b1fe 100644 --- a/vlib/net/tcp.c.v +++ b/vlib/net/tcp.c.v @@ -297,7 +297,7 @@ pub fn (c &TcpConn) peer_addr() !Addr { // peer_ip retrieves the ip address used by the peer, and returns it as a string pub fn (c &TcpConn) peer_ip() !string { - return c.peer_addr()!.str() + return c.peer_addr()!.str().all_before(':') } pub fn (c &TcpConn) addr() !Addr {