diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-04-29 17:37:47 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-04-29 17:37:47 +1200 |
commit | 5650086ca1927fd7aa21d102048c790d5a28b729 (patch) | |
tree | e119efaaa7befc8f9d4a0b72b48135d13425ac51 /libpathod/rparse.py | |
parent | f2b11e5d5c56c95acb10962ebb78ec32c502b696 (diff) | |
download | mitmproxy-5650086ca1927fd7aa21d102048c790d5a28b729.tar.gz mitmproxy-5650086ca1927fd7aa21d102048c790d5a28b729.tar.bz2 mitmproxy-5650086ca1927fd7aa21d102048c790d5a28b729.zip |
First pass at a README.
Diffstat (limited to 'libpathod/rparse.py')
-rw-r--r-- | libpathod/rparse.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libpathod/rparse.py b/libpathod/rparse.py index 8a461180..d3b3dbb5 100644 --- a/libpathod/rparse.py +++ b/libpathod/rparse.py @@ -344,7 +344,7 @@ class Response: version = "HTTP/1.1" code = 200 msg = LiteralGenerator(http.RESPONSES[code]) - body = LiteralGenerator("OK") + body = LiteralGenerator("") def __init__(self): self.headers = [] self.actions = [] @@ -429,6 +429,7 @@ class Response: sofar += len(d) skip = 0 fp.finish() + fp.connection.stream.close() def serve(self, fp): started = time.time() @@ -454,10 +455,9 @@ class Response: "\r\n", ] vals.extend(hdrs) - vals.extend([ - "\r\n", - self.body - ]) + vals.append("\r\n") + if self.body: + vals.append(self.body) vals.reverse() actions = self.ready_actions(self.length(), self.actions) actions.reverse() |