aboutsummaryrefslogtreecommitdiffstats
path: root/netlib/http/http1/protocol.py
diff options
context:
space:
mode:
Diffstat (limited to 'netlib/http/http1/protocol.py')
-rw-r--r--netlib/http/http1/protocol.py22
1 files changed, 5 insertions, 17 deletions
diff --git a/netlib/http/http1/protocol.py b/netlib/http/http1/protocol.py
index 401654c1..8d631a13 100644
--- a/netlib/http/http1/protocol.py
+++ b/netlib/http/http1/protocol.py
@@ -11,25 +11,10 @@ from ..exceptions import *
class HTTP1Protocol(object):
- # TODO: make this a regular class - just like Response
- Request = collections.namedtuple(
- "Request",
- [
- "form_in",
- "method",
- "scheme",
- "host",
- "port",
- "path",
- "httpversion",
- "headers",
- "content"
- ]
- )
-
def __init__(self, tcp_handler):
self.tcp_handler = tcp_handler
+
def get_request_line(self):
"""
Get a line, possibly preceded by a blank.
@@ -40,6 +25,7 @@ class HTTP1Protocol(object):
line = self.tcp_handler.rfile.readline()
return line
+
def read_headers(self):
"""
Read a set of headers.
@@ -175,6 +161,7 @@ class HTTP1Protocol(object):
return None
return host, port, httpversion
+
@classmethod
def parse_init_proxy(self, line):
v = self.parse_init(line)
@@ -188,6 +175,7 @@ class HTTP1Protocol(object):
scheme, host, port, path = parts
return method, scheme, host, port, path, httpversion
+
@classmethod
def parse_init_http(self, line):
"""
@@ -425,7 +413,7 @@ class HTTP1Protocol(object):
True
)
- return self.Request(
+ return http.Request(
form_in,
method,
scheme,