From b73569465391e6f159c6690fc08a566a2c0bbafb Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Mon, 3 Oct 2016 10:18:36 +1100 Subject: websockets_handshake -> websocket_handshake The plural feels awkward. --- docs/scripting/inlinescripts.rst | 2 +- mitmproxy/controller.py | 2 +- mitmproxy/flow/master.py | 2 +- mitmproxy/protocol/http.py | 2 +- pathod/pathod.py | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/scripting/inlinescripts.rst b/docs/scripting/inlinescripts.rst index 5e56e01e..74d4e714 100644 --- a/docs/scripting/inlinescripts.rst +++ b/docs/scripting/inlinescripts.rst @@ -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. diff --git a/mitmproxy/controller.py b/mitmproxy/controller.py index d886af97..ea084973 100644 --- a/mitmproxy/controller.py +++ b/mitmproxy/controller.py @@ -28,7 +28,7 @@ Events = frozenset([ "response", "responseheaders", - "websockets_handshake", + "websocket_handshake", "next_layer", diff --git a/mitmproxy/flow/master.py b/mitmproxy/flow/master.py index 80f633cd..de9d47f1 100644 --- a/mitmproxy/flow/master.py +++ b/mitmproxy/flow/master.py @@ -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): diff --git a/mitmproxy/protocol/http.py b/mitmproxy/protocol/http.py index d3e3c80f..4a30edb7 100644 --- a/mitmproxy/protocol/http.py +++ b/mitmproxy/protocol/http.py @@ -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( diff --git a/pathod/pathod.py b/pathod/pathod.py index bd0feb73..4f6c3d38 100644 --- a/pathod/pathod.py +++ b/pathod/pathod.py @@ -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: -- cgit v1.2.3