update ws and httpupgrade

This commit is contained in:
Alireza Ahmadi
2024-04-09 19:51:51 +02:00
parent e1696c9fd3
commit 649c96ef16
5 changed files with 67 additions and 63 deletions

View File

@@ -194,14 +194,14 @@ class WsStreamSettings extends CommonClass {
static fromJson(json={}) {
return new WsStreamSettings(
json.path,
json.headers && !ObjectUtil.isEmpty(json.headers.Host) ? json.headers.Host : '',
json.host,
);
}
toJson() {
return {
path: this.path,
headers: ObjectUtil.isEmpty(this.host) ? undefined : {Host: this.host},
host: this.host,
};
}
}