From d6cfa34667fe808975279c237d4ac9fe612631d8 Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Mon, 13 Sep 2021 23:12:16 +0300 Subject: AK: Make URL::m_port an Optional, Expose raw port getter Our current way of signalling a missing port with m_port == 0 was lacking, as 0 is a valid port number in URLs. --- Userland/Libraries/LibWebSocket/Impl/TCPWebSocketConnectionImpl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Userland/Libraries/LibWebSocket/Impl/TCPWebSocketConnectionImpl.cpp') diff --git a/Userland/Libraries/LibWebSocket/Impl/TCPWebSocketConnectionImpl.cpp b/Userland/Libraries/LibWebSocket/Impl/TCPWebSocketConnectionImpl.cpp index db25972710..709f28fc7f 100644 --- a/Userland/Libraries/LibWebSocket/Impl/TCPWebSocketConnectionImpl.cpp +++ b/Userland/Libraries/LibWebSocket/Impl/TCPWebSocketConnectionImpl.cpp @@ -34,7 +34,7 @@ void TCPWebSocketConnectionImpl::connect(ConnectionInfo const& connection) m_socket->on_connected = [this] { on_connected(); }; - bool success = m_socket->connect(connection.url().host(), connection.url().port()); + bool success = m_socket->connect(connection.url().host(), connection.url().port_or_default()); if (!success) { deferred_invoke([this] { on_connection_error(); -- cgit v1.2.3