aboutsummaryrefslogtreecommitdiffstats
path: root/libpathod
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-07-20 23:47:34 +1200
committerAldo Cortesi <aldo@nullcube.com>2012-07-20 23:47:34 +1200
commit8e0c01ae39f2f1f80ad0d372119e8654de21d29c (patch)
treee8d8b23eb0500855b3d4b6193dea2077c0472f31 /libpathod
parentd7841898e39b7bb1854f7c066ccccaaa84ab2f2c (diff)
downloadmitmproxy-8e0c01ae39f2f1f80ad0d372119e8654de21d29c.tar.gz
mitmproxy-8e0c01ae39f2f1f80ad0d372119e8654de21d29c.tar.bz2
mitmproxy-8e0c01ae39f2f1f80ad0d372119e8654de21d29c.zip
Fine-tuning for injection: docs, bugfixes.
Diffstat (limited to 'libpathod')
-rw-r--r--libpathod/rparse.py11
-rw-r--r--libpathod/templates/docs_pathod.html11
2 files changed, 20 insertions, 2 deletions
diff --git a/libpathod/rparse.py b/libpathod/rparse.py
index 5a2f84b1..e71265ea 100644
--- a/libpathod/rparse.py
+++ b/libpathod/rparse.py
@@ -421,7 +421,8 @@ class InjectAt:
e = e + pp.MatchFirst(
[
v_integer,
- pp.Literal("r")
+ pp.Literal("r"),
+ pp.Literal("a")
]
)
e += pp.Literal(",").suppress()
@@ -429,7 +430,13 @@ class InjectAt:
return e.setParseAction(lambda x: klass(*x))
def accept(self, settings, r):
- r.actions.append((self.offset, "inject", self.value))
+ r.actions.append(
+ (
+ self.offset,
+ "inject",
+ self.value.get_generator(settings)
+ )
+ )
class Header:
diff --git a/libpathod/templates/docs_pathod.html b/libpathod/templates/docs_pathod.html
index 1527f851..8fc062ca 100644
--- a/libpathod/templates/docs_pathod.html
+++ b/libpathod/templates/docs_pathod.html
@@ -159,6 +159,17 @@ various other goodies. Try it by visiting the server root:</p>
<tr>
<td>
+ iOFFSET,VALUE
+ </td>
+ <td>
+ Inject the specified value at the offset. OFFSET can be an
+ integer, or "r" to generate a random offset or "a" for an
+ offset just after all data has been sent.
+ </td>
+ </tr>
+
+ <tr>
+ <td>
lVALUE
</td>
<td>