Skip to content

Commit

Permalink
fixed issue where SSL websockets wouldn't run due to HTTP upgrade
Browse files Browse the repository at this point in the history
(cherry picked from commit 0a739b3)
  • Loading branch information
The-EDev committed Apr 29, 2022
1 parent cd3bdc3 commit bc3a742
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions include/crow/http_connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit bc3a742

Please sign in to comment.