mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-18 20:50:09 +08:00
fix host header in websocket
This commit is contained in:
parent
bfd7e438aa
commit
44914f01d3
@ -72,10 +72,17 @@ namespace Configs {
|
||||
method = "GET";
|
||||
}
|
||||
}
|
||||
if (query.hasQueryItem("host")) host = query.queryItemValue("host");
|
||||
if (query.hasQueryItem("host")) {
|
||||
host = query.queryItemValue("host");
|
||||
if (type == "ws") headers << "host" << host;
|
||||
}
|
||||
if (query.hasQueryItem("path")) path = query.queryItemValue("path");
|
||||
if (query.hasQueryItem("method")) method = query.queryItemValue("method");
|
||||
if (query.hasQueryItem("headers")) headers = query.queryItemValue("headers").split(",");
|
||||
if (query.hasQueryItem("headers")) {
|
||||
auto headersImported = query.queryItemValue("headers").split(",");
|
||||
if (headersImported.contains("host")) headers = headersImported;
|
||||
else headers << headersImported;
|
||||
}
|
||||
if (query.hasQueryItem("idle_timeout")) idle_timeout = query.queryItemValue("idle_timeout");
|
||||
if (query.hasQueryItem("ping_timeout")) ping_timeout = query.queryItemValue("ping_timeout");
|
||||
if (query.hasQueryItem("max_early_data")) max_early_data = query.queryItemValue("max_early_data").toInt();
|
||||
@ -121,7 +128,7 @@ namespace Configs {
|
||||
QJsonObject object;
|
||||
if (type.isEmpty() || type == "tcp") return object;
|
||||
if (!type.isEmpty()) object["type"] = type;
|
||||
if (!host.isEmpty()) object["host"] = host;
|
||||
if (!host.isEmpty() && (type == "http" || type == "httpupgrade")) object["host"] = host;
|
||||
if (!path.isEmpty()) object["path"] = path;
|
||||
if (!method.isEmpty()) object["method"] = method;
|
||||
if (!headers.isEmpty()) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user