mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-11-22 15:58:03 +00:00
check if Upgrade/upgrade header is complete
This commit is contained in:
1 parent
793431aed3
commit
76fc49a886
2 files changed
+2
-2
No files matched your search
@@ -353,7 +353,7 @@ namespace proxy
|
||||
/* close connection, if not Connection: (U|u)pgrade (for websocket) */
|
||||
auto h = req.GetHeader ("Connection");
|
||||
auto x = h.find("pgrade");
|
||||
if (!(x != std::string::npos && std::tolower(h[x - 1]) == 'u'))
|
||||
if (x == std::string::npos || !x || std::tolower(h[x - 1]) != 'u')
|
||||
req.UpdateHeader("Connection", "close");
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user