websockets_handshake -> websocket_handshake

The plural feels awkward.
This commit is contained in:
Aldo Cortesi 2016-10-03 10:18:36 +11:00
parent b0add569b9
commit b735694653
5 changed files with 7 additions and 7 deletions

View File

@ -128,7 +128,7 @@ HTTP Events
WebSockets Events
^^^^^^^^^^^^^^^^^
.. py:function:: websockets_handshake(context, flow)
.. py:function:: websocket_handshake(context, flow)
Called when a client wants to establish a WebSockets connection.
The WebSockets-specific headers can be manipulated to manipulate the handshake.

View File

@ -28,7 +28,7 @@ Events = frozenset([
"response",
"responseheaders",
"websockets_handshake",
"websocket_handshake",
"next_layer",

View File

@ -246,7 +246,7 @@ class FlowMaster(controller.Master):
self.state.update_flow(f)
@controller.handler
def websockets_handshake(self, f):
def websocket_handshake(self, f):
pass
def handle_intercept(self, f):

View File

@ -200,7 +200,7 @@ class HttpLayer(base.Layer):
if websockets.check_handshake(request.headers) and websockets.check_client_version(request.headers):
# We only support RFC6455 with WebSockets version 13
# allow inline scripts to manipulate the client handshake
self.channel.ask("websockets_handshake", flow)
self.channel.ask("websocket_handshake", flow)
if not flow.response:
self.establish_server_connection(

View File

@ -174,12 +174,12 @@ class PathodHandler(tcp.BaseHandler):
m = utils.MemBool()
valid_websockets_handshake = websockets.check_handshake(headers)
valid_websocket_handshake = websockets.check_handshake(headers)
self.settings.websocket_key = websockets.get_client_key(headers)
# If this is a websocket initiation, we respond with a proper
# server response, unless over-ridden.
if valid_websockets_handshake:
if valid_websocket_handshake:
anchor_gen = language.parse_pathod("ws")
else:
anchor_gen = None
@ -226,7 +226,7 @@ class PathodHandler(tcp.BaseHandler):
spec,
lg
)
if nexthandler and valid_websockets_handshake:
if nexthandler and valid_websocket_handshake:
self.protocol = protocols.websockets.WebsocketsProtocol(self)
return self.protocol.handle_websocket, retlog
else: