Skip to content

Commit

Permalink
Merge pull request #4218 from si458/patch-1
Browse files Browse the repository at this point in the history
if header is not null for websockets
  • Loading branch information
Ylianst authored Jul 4, 2022
2 parents 0d61ce5 + 0f85b18 commit 513e5b5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions apprelays.js
Original file line number Diff line number Diff line change
Expand Up @@ -642,12 +642,14 @@ module.exports.CreateWebRelay = function (parent, db, args, domain) {
}
} else {
// Tunnel is now in web socket pass-thru mode
if ((typeof header.connection == 'string') && (header.connection.toLowerCase() == 'upgrade')) {
// Websocket upgrade succesful
obj.socketParseState = 2;
} else {
// Unable to upgrade to web socket
obj.close();
if (header != null) {
if ((typeof header.connection == 'string') && (header.connection.toLowerCase() == 'upgrade')) {
// Websocket upgrade succesful
obj.socketParseState = 2;
} else {
// Unable to upgrade to web socket
obj.close();
}
}
}
}
Expand Down

0 comments on commit 513e5b5

Please sign in to comment.