Skip to content

Commit bc3a742

Browse files
committed
fixed issue where SSL websockets wouldn't run due to HTTP upgrade
(cherry picked from commit 0a739b3)
1 parent cd3bdc3 commit bc3a742

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

Diff for: include/crow/http_connection.h

+2-17
Original file line numberDiff line numberDiff line change
@@ -129,27 +129,12 @@ namespace crow
129129
}
130130
if (req.upgrade)
131131
{
132-
#ifdef CROW_ENABLE_SSL
133-
if (handler_->ssl_used())
134-
{
135-
if (req.get_header_value("upgrade") == "h2")
136-
{
137-
// TODO(ipkn): HTTP/2
138-
// currently, ignore upgrade header
139-
}
140-
}
141-
else if (req.get_header_value("upgrade") == "h2c")
142-
{
143-
// TODO(ipkn): HTTP/2
144-
// currently, ignore upgrade header
145-
}
146-
#else
147-
if (req.get_header_value("upgrade") == "h2c")
132+
// h2 or h2c headers
133+
if (req.get_header_value("upgrade").substr(0, 2) == "h2")
148134
{
149135
// TODO(ipkn): HTTP/2
150136
// currently, ignore upgrade header
151137
}
152-
#endif
153138
else
154139
{
155140
close_connection_ = true;

0 commit comments

Comments
 (0)