aboutsummaryrefslogtreecommitdiffstats
path: root/libpathod/language/http.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2015-05-03 08:02:13 +1200
committerAldo Cortesi <aldo@nullcube.com>2015-05-03 08:02:13 +1200
commit5d5f2bdd1f2354b9a1b204964fa05488772695f8 (patch)
tree8df2d51e14d9d30b3aac1f439d4ff4af10200b12 /libpathod/language/http.py
parent24437ba18055444e999638caae9273012e2fd535 (diff)
downloadmitmproxy-5d5f2bdd1f2354b9a1b204964fa05488772695f8.tar.gz
mitmproxy-5d5f2bdd1f2354b9a1b204964fa05488772695f8.tar.bz2
mitmproxy-5d5f2bdd1f2354b9a1b204964fa05488772695f8.zip
Split out language messages and actions
Diffstat (limited to 'libpathod/language/http.py')
-rw-r--r--libpathod/language/http.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/libpathod/language/http.py b/libpathod/language/http.py
index a759aeb1..c1c2ae96 100644
--- a/libpathod/language/http.py
+++ b/libpathod/language/http.py
@@ -5,7 +5,7 @@ import contrib.pyparsing as pp
import netlib.websockets
from netlib import http_status, http_uastrings
-from . import base, generators, exceptions
+from . import base, generators, exceptions, actions, message
class WS(base.CaselessLiteral):
@@ -100,8 +100,11 @@ def get_header(val, headers):
return None
-class _HTTPMessage(base._Message):
+class _HTTPMessage(message.Message):
version = "HTTP/1.1"
+ @property
+ def actions(self):
+ return self.toks(actions._Action)
@property
def raw(self):
@@ -134,13 +137,14 @@ class Response(_HTTPMessage):
comps = (
Body,
Header,
- base.PauseAt,
- base.DisconnectAt,
- base.InjectAt,
ShortcutContentType,
ShortcutLocation,
Raw,
- Reason
+ Reason,
+
+ actions.PauseAt,
+ actions.DisconnectAt,
+ actions.InjectAt,
)
logattrs = ["code", "reason", "version", "body"]
@@ -241,13 +245,14 @@ class Request(_HTTPMessage):
comps = (
Body,
Header,
- base.PauseAt,
- base.DisconnectAt,
- base.InjectAt,
ShortcutContentType,
ShortcutUserAgent,
Raw,
base.PathodSpec,
+
+ actions.PauseAt,
+ actions.DisconnectAt,
+ actions.InjectAt,
)
logattrs = ["method", "path", "body"]