mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
update comments
This commit is contained in:
parent
53e15f778d
commit
66bd27e6f9
@ -225,7 +225,7 @@ class HTTPResponse(MessageMixin, Response):
|
|||||||
|
|
||||||
headers: Headers object
|
headers: Headers object
|
||||||
|
|
||||||
content: Content of the request, the value is None if there is content
|
content: Content of the response, the value is None if there is content
|
||||||
associated, but not present.
|
associated, but not present.
|
||||||
|
|
||||||
timestamp_start: Timestamp indicating when request transmission started
|
timestamp_start: Timestamp indicating when request transmission started
|
||||||
|
@ -50,8 +50,8 @@ class _HttpTransmissionLayer(Layer):
|
|||||||
yield "this is a generator" # pragma: no cover
|
yield "this is a generator" # pragma: no cover
|
||||||
|
|
||||||
def send_response(self, response):
|
def send_response(self, response):
|
||||||
if response.content == None:
|
if response.content is None:
|
||||||
raise HttpException("Cannot assemble flow with None content")
|
raise HttpException("Cannot assemble flow with missing content")
|
||||||
self.send_response_headers(response)
|
self.send_response_headers(response)
|
||||||
self.send_response_body(response, [response.content])
|
self.send_response_body(response, [response.content])
|
||||||
|
|
||||||
|
@ -5,8 +5,8 @@ import itertools
|
|||||||
from ...exceptions import HttpException
|
from ...exceptions import HttpException
|
||||||
|
|
||||||
def assemble_request(request):
|
def assemble_request(request):
|
||||||
if request.content == None:
|
if request.content is None:
|
||||||
raise HttpException("Cannot assemble flow with None content")
|
raise HttpException("Cannot assemble flow with missing content")
|
||||||
head = assemble_request_head(request)
|
head = assemble_request_head(request)
|
||||||
body = b"".join(assemble_body(request.data.headers, [request.data.content]))
|
body = b"".join(assemble_body(request.data.headers, [request.data.content]))
|
||||||
return head + body
|
return head + body
|
||||||
@ -19,8 +19,8 @@ def assemble_request_head(request):
|
|||||||
|
|
||||||
|
|
||||||
def assemble_response(response):
|
def assemble_response(response):
|
||||||
if response.content == None:
|
if response.content is None:
|
||||||
raise HttpException("Cannot assemble flow with None content")
|
raise HttpException("Cannot assemble flow with missing content")
|
||||||
head = assemble_response_head(response)
|
head = assemble_response_head(response)
|
||||||
body = b"".join(assemble_body(response.data.headers, [response.data.content]))
|
body = b"".join(assemble_body(response.data.headers, [response.data.content]))
|
||||||
return head + body
|
return head + body
|
||||||
|
Loading…
Reference in New Issue
Block a user