aboutsummaryrefslogtreecommitdiffstats
path: root/libpathod/language/http.py
diff options
context:
space:
mode:
authorThomas Kriechbaumer <thomas@kriechbaumer.name>2015-06-22 12:42:39 +0200
committerThomas Kriechbaumer <thomas@kriechbaumer.name>2015-06-25 14:59:22 +0200
commit46255e6e9cfca6ee5b32d287be7d2a0eb8d73c20 (patch)
treedf38da5b168a994705f16bced7dfc3d3843111e7 /libpathod/language/http.py
parent09d76e1758378d0d8604bdce61a1480584c3c72a (diff)
downloadmitmproxy-46255e6e9cfca6ee5b32d287be7d2a0eb8d73c20.tar.gz
mitmproxy-46255e6e9cfca6ee5b32d287be7d2a0eb8d73c20.tar.bz2
mitmproxy-46255e6e9cfca6ee5b32d287be7d2a0eb8d73c20.zip
http2: implement more language features
Diffstat (limited to 'libpathod/language/http.py')
-rw-r--r--libpathod/language/http.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/libpathod/language/http.py b/libpathod/language/http.py
index 3979a1ee..3c9df484 100644
--- a/libpathod/language/http.py
+++ b/libpathod/language/http.py
@@ -82,12 +82,10 @@ class ShortcutUserAgent(_HeaderMixin, base.OptionsOrValue):
key = base.TokValueLiteral("User-Agent")
def values(self, settings):
+ value = self.value.val
if self.option_used:
- value = http_uastrings.get_by_shortcut(
- self.value.val.lower()
- )[2]
- else:
- value = self.value.val
+ value = http_uastrings.get_by_shortcut(value.lower())[2]
+
return self.format_header(
self.key.get_generator(settings),
value
@@ -143,12 +141,12 @@ class _HTTPMessage(message.Message):
class Response(_HTTPMessage):
unique_name = None
comps = (
- Body,
Header,
ShortcutContentType,
ShortcutLocation,
Raw,
Reason,
+ Body,
actions.PauseAt,
actions.DisconnectAt,
@@ -256,12 +254,12 @@ class NestedResponse(base.NestedMessage):
class Request(_HTTPMessage):
comps = (
- Body,
Header,
ShortcutContentType,
ShortcutUserAgent,
Raw,
NestedResponse,
+ Body,
Times,
actions.PauseAt,