Skip to content
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.

Commit

Permalink
Merge pull request #16 from Qv2ray/patch-empty-websocket-host
Browse files Browse the repository at this point in the history
applying patch (#15)
  • Loading branch information
DuckSoft committed Jan 28, 2021
2 parents f43af2b + 9abdab0 commit 21d7b21
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion core/Serializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include <QObject>
#include <QUrl>
#include <QUrlQuery>
#include <QtDebug>
#include <QtGlobal>

using namespace Qv2rayPlugin;

Expand Down Expand Up @@ -34,7 +36,14 @@ class TrojanGoSerializer : public PluginOutboundHandler
query.addQueryItem("sni", obj.sni);
if (obj.type == TRANSPORT_WEBSOCKET)
{
query.addQueryItem("host", QUrl::toPercentEncoding(obj.host));
if (!obj.host.isEmpty())
{
query.addQueryItem("host", QUrl::toPercentEncoding(obj.host));
}
else
{
qWarning() << "empty host is deprecated when websocket is used";
}
query.addQueryItem("path", QUrl::toPercentEncoding(obj.path));
if (!obj.encryption.isEmpty())
query.addQueryItem("encryption", QUrl::toPercentEncoding(obj.encryption));
Expand Down

0 comments on commit 21d7b21

Please sign in to comment.