aboutsummaryrefslogtreecommitdiffstats
path: root/netlib/http/semantics.py
diff options
context:
space:
mode:
authorThomas Kriechbaumer <thomas@kriechbaumer.name>2015-07-22 13:01:24 +0200
committerThomas Kriechbaumer <thomas@kriechbaumer.name>2015-07-22 16:13:06 +0200
commit657973eca3b091cdf07a65f8363affd3d36f0d0f (patch)
treea6ee3ae4aa49e1b9922e48d4b05afe03bc8effdd /netlib/http/semantics.py
parentfaf17d3d60e658d0cd1df30a10be4f11035502f8 (diff)
downloadmitmproxy-657973eca3b091cdf07a65f8363affd3d36f0d0f.tar.gz
mitmproxy-657973eca3b091cdf07a65f8363affd3d36f0d0f.tar.bz2
mitmproxy-657973eca3b091cdf07a65f8363affd3d36f0d0f.zip
fix bugs
Diffstat (limited to 'netlib/http/semantics.py')
-rw-r--r--netlib/http/semantics.py28
1 files changed, 11 insertions, 17 deletions
diff --git a/netlib/http/semantics.py b/netlib/http/semantics.py
index 355906dd..9e13edaa 100644
--- a/netlib/http/semantics.py
+++ b/netlib/http/semantics.py
@@ -5,7 +5,7 @@ import string
import sys
import urlparse
-from .. import utils
+from .. import utils, odict
class Request(object):
@@ -37,6 +37,10 @@ class Request(object):
def __repr__(self):
return "Request(%s - %s, %s)" % (self.method, self.host, self.path)
+ @property
+ def content(self):
+ return self.body
+
class EmptyRequest(Request):
def __init__(self):
@@ -47,22 +51,8 @@ class EmptyRequest(Request):
host="",
port="",
path="",
- httpversion="",
- headers="",
- body="",
- )
-
-class ConnectRequest(Request):
- def __init__(self, host, port):
- super(ConnectRequest, self).__init__(
- form_in="authority",
- method="CONNECT",
- scheme="",
- host=host,
- port=port,
- path="",
- httpversion="",
- headers="",
+ httpversion=(0, 0),
+ headers=odict.ODictCaseless(),
body="",
)
@@ -91,6 +81,10 @@ class Response(object):
def __repr__(self):
return "Response(%s - %s)" % (self.status_code, self.msg)
+ @property
+ def content(self):
+ return self.body
+
def is_valid_port(port):
if not 0 <= port <= 65535: