From 0a739b35c6a2548bd2feb7acf9f53d5fbbfb69ba Mon Sep 17 00:00:00 2001 From: The-EDev Date: Thu, 7 Apr 2022 15:54:50 +0300 Subject: [PATCH] fixed issue where SSL websockets wouldn't run due to HTTP upgrade --- include/crow/http_connection.h | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/include/crow/http_connection.h b/include/crow/http_connection.h index f8ce97894..8a57a8b31 100644 --- a/include/crow/http_connection.h +++ b/include/crow/http_connection.h @@ -129,27 +129,12 @@ namespace crow } if (req.upgrade) { -#ifdef CROW_ENABLE_SSL - if (handler_->ssl_used()) - { - if (req.get_header_value("upgrade") == "h2") - { - // TODO(ipkn): HTTP/2 - // currently, ignore upgrade header - } - } - else if (req.get_header_value("upgrade") == "h2c") - { - // TODO(ipkn): HTTP/2 - // currently, ignore upgrade header - } -#else - if (req.get_header_value("upgrade") == "h2c") + // h2 or h2c headers + if (req.get_header_value("upgrade").substr(0, 2) == "h2") { // TODO(ipkn): HTTP/2 // currently, ignore upgrade header } -#endif else { close_connection_ = true;