From ac480eb396e306c67a26b5b459d399c8c2be23f5 Mon Sep 17 00:00:00 2001 From: Qv2ray-dev <59914293+Qv2ray-dev@users.noreply.github.com> Date: Mon, 16 Mar 2020 18:22:51 +0800 Subject: [PATCH] fix: feel free to use empty host with http/h2 in your vmess --- makespec/BUILDVERSION | 2 +- src/core/connection/Serialization_vmess.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/makespec/BUILDVERSION b/makespec/BUILDVERSION index 3c596919..6aec326c 100644 --- a/makespec/BUILDVERSION +++ b/makespec/BUILDVERSION @@ -1 +1 @@ -4716 \ No newline at end of file +4718 diff --git a/src/core/connection/Serialization_vmess.cpp b/src/core/connection/Serialization_vmess.cpp index 4a985c11..4c10d8b9 100644 --- a/src/core/connection/Serialization_vmess.cpp +++ b/src/core/connection/Serialization_vmess.cpp @@ -234,7 +234,10 @@ namespace Qv2ray::core::connection // Fill hosts for HTTP for (auto _host : host.split(',')) { - streaming.httpSettings.host.push_back(_host.trimmed()); + if (!_host.isEmpty()) + { + streaming.httpSettings.host.push_back(_host.trimmed()); + } } streaming.httpSettings.path = path; @@ -271,7 +274,8 @@ namespace Qv2ray::core::connection // // Network type // NOTE(DuckSoft): Damn vmess:// just don't write 'http' properly - if (net == "h2") net = "http"; + if (net == "h2") + net = "http"; streaming.network = net; // // WARN Mux is missing here.