Skip to content
Browse files

Echo close reason and close code

Set code to None if it is STATUS_NO_STATUS_RECEIVED, which should not be
sent across the wire.
  • Loading branch information...
jsanders committed Jan 12, 2016
1 parent 175b3c2 commit a640b9aaeaeb054276ca6bdb6982c5346f9548d3
Showing with 11 additions and 0 deletions.
  1. +11 −0 tests/wpt/web-platform-tests/websockets/handlers/
@@ -1,5 +1,6 @@
from mod_pywebsocket import msgutil
from mod_pywebsocket import common


@@ -23,3 +24,13 @@ def web_socket_transfer_data(request):
request.ws_stream.send_message(line, binary=True)

def web_socket_passive_closing_handshake(request):
# Echo close status code and reason
code, reason = request.ws_close_code, request.ws_close_reason

# No status received is a reserved pseudo code representing an empty code,
# so echo back an empty code in this case.
if code == common.STATUS_NO_STATUS_RECEIVED:
code = None

return code, reason

0 comments on commit a640b9a

Please sign in to comment.
You can’t perform that action at this time.