Skip to content

Commit 8b0bac4

Browse files
bsnychKriechi
andauthored
Added missing "reason" to ensure backward compatibility (#190)
* 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 * linting --------- Co-authored-by: Thomas Kriechbaumer <[email protected]>
1 parent b3553ae commit 8b0bac4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/wsproto/handshake.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,9 @@ 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,
290+
headers=headers + event.extra_headers,
291+
reason=b"Switching Protocols",
290292
)
291293
self._connection = Connection(
292294
ConnectionType.CLIENT if self.client else ConnectionType.SERVER,

0 commit comments

Comments
 (0)