mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-19 05:30:06 +08:00
Fix ws transport host header import again
This commit is contained in:
parent
5b7ac27608
commit
2911d03476
@ -93,8 +93,19 @@ namespace Configs {
|
|||||||
if (object.contains("headers") && object["headers"].isObject()) {
|
if (object.contains("headers") && object["headers"].isObject()) {
|
||||||
auto headerObj = object["headers"].toObject();
|
auto headerObj = object["headers"].toObject();
|
||||||
if (type == "ws") {
|
if (type == "ws") {
|
||||||
if (headerObj.contains("Host")) host = headerObj["Host"].toString();
|
if (headerObj.contains("Host")) {
|
||||||
headerObj.remove("Host");
|
if (headerObj["Host"].isString()) {
|
||||||
|
host = headerObj["Host"].toString();
|
||||||
|
} else if (headerObj["Host"].isArray()) {
|
||||||
|
for (const auto& v : headerObj["Host"].toArray()) {
|
||||||
|
if (v.isString()) {
|
||||||
|
host = v.toString();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
headerObj.remove("Host");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
headers = jsonObjectToQStringList(headerObj);
|
headers = jsonObjectToQStringList(headerObj);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user