mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-19 05:30:06 +08:00
Fix ws transport host header import
This commit is contained in:
parent
796dd4f536
commit
ca3da15056
@ -91,7 +91,12 @@ namespace Configs {
|
|||||||
if (object.contains("path")) path = object["path"].toString();
|
if (object.contains("path")) path = object["path"].toString();
|
||||||
if (object.contains("method")) method = object["method"].toString();
|
if (object.contains("method")) method = object["method"].toString();
|
||||||
if (object.contains("headers") && object["headers"].isObject()) {
|
if (object.contains("headers") && object["headers"].isObject()) {
|
||||||
headers = jsonObjectToQStringList(object["headers"].toObject());
|
auto headerObj = object["headers"].toObject();
|
||||||
|
if (type == "ws") {
|
||||||
|
if (headerObj.contains("Host")) host = headerObj["Host"].toString();
|
||||||
|
headerObj.remove("Host");
|
||||||
|
}
|
||||||
|
headers = jsonObjectToQStringList(headerObj);
|
||||||
}
|
}
|
||||||
if (object.contains("idle_timeout")) idle_timeout = object["idle_timeout"].toString();
|
if (object.contains("idle_timeout")) idle_timeout = object["idle_timeout"].toString();
|
||||||
if (object.contains("ping_timeout")) ping_timeout = object["ping_timeout"].toString();
|
if (object.contains("ping_timeout")) ping_timeout = object["ping_timeout"].toString();
|
||||||
@ -130,7 +135,7 @@ namespace Configs {
|
|||||||
if (type == "http" || type == "httpupgrade") object["host"] = host;
|
if (type == "http" || type == "httpupgrade") object["host"] = host;
|
||||||
if (type == "ws") {
|
if (type == "ws") {
|
||||||
auto headersObj = object["headers"].isObject() ? object["headers"].toObject() : QJsonObject();
|
auto headersObj = object["headers"].isObject() ? object["headers"].toObject() : QJsonObject();
|
||||||
headersObj["host"] = host;
|
headersObj["Host"] = host;
|
||||||
object["headers"] = headersObj;
|
object["headers"] = headersObj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user