aboutsummaryrefslogtreecommitdiffstats
path: root/netlib/http
diff options
context:
space:
mode:
Diffstat (limited to 'netlib/http')
-rw-r--r--netlib/http/__init__.py4
-rw-r--r--netlib/http/http1/assemble.py10
-rw-r--r--netlib/http/message.py2
3 files changed, 6 insertions, 10 deletions
diff --git a/netlib/http/__init__.py b/netlib/http/__init__.py
index fd632cd5..917080f7 100644
--- a/netlib/http/__init__.py
+++ b/netlib/http/__init__.py
@@ -2,13 +2,13 @@ from __future__ import absolute_import, print_function, division
from .request import Request
from .response import Response
from .headers import Headers
-from .message import decoded, CONTENT_MISSING
+from .message import decoded
from . import http1, http2
__all__ = [
"Request",
"Response",
"Headers",
- "decoded", "CONTENT_MISSING",
+ "decoded",
"http1", "http2",
]
diff --git a/netlib/http/http1/assemble.py b/netlib/http/http1/assemble.py
index 785ee8d3..db5a49ce 100644
--- a/netlib/http/http1/assemble.py
+++ b/netlib/http/http1/assemble.py
@@ -3,12 +3,10 @@ from __future__ import absolute_import, print_function, division
from ... import utils
import itertools
from ...exceptions import HttpException
-from .. import CONTENT_MISSING
-
def assemble_request(request):
- if request.content == CONTENT_MISSING:
- raise HttpException("Cannot assemble flow with CONTENT_MISSING")
+ if request.content == None:
+ raise HttpException("Cannot assemble flow with None content")
head = assemble_request_head(request)
body = b"".join(assemble_body(request.data.headers, [request.data.content]))
return head + body
@@ -21,8 +19,8 @@ def assemble_request_head(request):
def assemble_response(response):
- if response.content == CONTENT_MISSING:
- raise HttpException("Cannot assemble flow with CONTENT_MISSING")
+ if response.content == None:
+ raise HttpException("Cannot assemble flow with None content")
head = assemble_response_head(response)
body = b"".join(assemble_body(response.data.headers, [response.data.content]))
return head + body
diff --git a/netlib/http/message.py b/netlib/http/message.py
index 4ddc1b81..1df0f087 100644
--- a/netlib/http/message.py
+++ b/netlib/http/message.py
@@ -7,8 +7,6 @@ import six
from .headers import Headers
from .. import encoding, utils
-CONTENT_MISSING = None
-
if six.PY2: # pragma: nocover
_native = lambda x: x
_always_bytes = lambda x: x