Skip to content

Commit 953e398

Browse files
bsnychKriechi
authored andcommitted
Added missing "reason" to ensure backward compatibility
Reason added for Informational response to socket connection upgrade. This ensures backwards compatibility for older socket libraries like: OCaml/websokets
1 parent b3553ae commit 953e398

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wsproto/handshake.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ def _accept(self, event: AcceptConnection) -> bytes:
286286
headers.append((b"Sec-WebSocket-Extensions", accepts))
287287

288288
response = h11.InformationalResponse(
289-
status_code=101, headers=headers + event.extra_headers
289+
status_code=101, headers=headers + event.extra_headers, reason=b"Switching Protocols"
290290
)
291291
self._connection = Connection(
292292
ConnectionType.CLIENT if self.client else ConnectionType.SERVER,

0 commit comments

Comments
 (0)