Skip to content

Commit e0a38c8

Browse files
mu2019jbr
authored andcommitted
fix firefox can't entablish websocket.
firefox send websocket upgrade header "Connection:keep-alive, Upgrade" can't match with connection_header_as_str.eq_ignore_ascii_case("upgrade")
1 parent 3e88655 commit e0a38c8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/server/mod.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,9 @@ where
165165
.map(|connection| connection.as_str())
166166
.unwrap_or("");
167167

168-
let connection_header_is_upgrade = connection_header_as_str.eq_ignore_ascii_case("upgrade");
168+
let connection_header_is_upgrade = connection_header_as_str
169+
.split(',')
170+
.any(|s| s.trim().eq_ignore_ascii_case("upgrade"));
169171

170172
let mut close_connection = if req.version() == Some(Version::Http1_0) {
171173
!connection_header_as_str.eq_ignore_ascii_case("keep-alive")

0 commit comments

Comments
 (0)