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

Commit

Permalink
fix: do not export host/port/encryption when using type=original
Browse files Browse the repository at this point in the history
  • Loading branch information
Qv2ray-dev authored and Qv2ray-dev committed Aug 6, 2020
1 parent 135d0b8 commit e0661c5
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions core/Serializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ class TrojanGoSerializer : public Qv2rayPlugin::QvPluginSerializer
//
query.addQueryItem("sni", obj.sni);
query.addQueryItem("type", TRANSPORT_TYPE_STRING_MAP[obj.type]);
query.addQueryItem("host", QUrl::toPercentEncoding(obj.host));
query.addQueryItem("path", QUrl::toPercentEncoding(obj.path));
if (!obj.encryption.isEmpty())
query.addQueryItem("encryption", QUrl::toPercentEncoding(obj.encryption));
if (!obj.plugin.isEmpty())
query.addQueryItem("plugin", QUrl::toPercentEncoding(obj.plugin));

if (obj.type == TRANSPORT_WEBSOCKET)
{
query.addQueryItem("host", QUrl::toPercentEncoding(obj.host));
query.addQueryItem("path", QUrl::toPercentEncoding(obj.path));
if (!obj.encryption.isEmpty())
query.addQueryItem("encryption", QUrl::toPercentEncoding(obj.encryption));
if (!obj.plugin.isEmpty())
query.addQueryItem("plugin", QUrl::toPercentEncoding(obj.plugin));
}
url.setQuery(query);
return url.toString(QUrl::FullyDecoded);
}
Expand Down

0 comments on commit e0661c5

Please sign in to comment.