From ea6ef2779e0955cba2a9c2de770084afd02f21a2 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Sun, 29 May 2022 21:36:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Eurl=E5=88=A4=E7=A9=BA?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Common/Parser.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Common/Parser.cpp b/src/Common/Parser.cpp index 6f9dc810..f57fcca3 100644 --- a/src/Common/Parser.cpp +++ b/src/Common/Parser.cpp @@ -212,6 +212,7 @@ static void inline checkHost(std::string &host) { } void splitUrl(const std::string &url, std::string &host, uint16_t &port) { + CHECK(!url.empty(), "empty url"); auto pos = url.rfind(':'); if (pos == string::npos || url.back() == ']') { //没有冒号,未指定端口;或者是纯粹的ipv6地址