diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-07-25 15:12:20 -0700 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-07-25 15:12:20 -0700 |
commit | 3254595584e1d711e7ae292ad34753a52f7a0fc1 (patch) | |
tree | 5b92cd7df813825b11ad1c11b10bb007160ecd78 | |
parent | 68e437a740a1e3d7356c4f637337aba471ec222f (diff) | |
download | mitmproxy-3254595584e1d711e7ae292ad34753a52f7a0fc1.tar.gz mitmproxy-3254595584e1d711e7ae292ad34753a52f7a0fc1.tar.bz2 mitmproxy-3254595584e1d711e7ae292ad34753a52f7a0fc1.zip |
minor fixes
-rw-r--r-- | mitmproxy/web/app.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/mitmproxy/web/app.py b/mitmproxy/web/app.py index 848ca474..8ccc21c5 100644 --- a/mitmproxy/web/app.py +++ b/mitmproxy/web/app.py @@ -47,8 +47,8 @@ def convert_flow_to_json_dict(flow): "path": flow.request.path, "http_version": flow.request.http_version, "headers": tuple(flow.request.headers.items(True)), - "contentLength": len(flow.request.content) if flow.request.content is not None else None, - "contentHash": hashlib.sha256(flow.request.raw_content).hexdigest() if flow.request.content is not None else None, + "contentLength": len(flow.request.raw_content) if flow.request.raw_content is not None else None, + "contentHash": hashlib.sha256(flow.request.raw_content).hexdigest() if flow.request.raw_content is not None else None, "timestamp_start": flow.request.timestamp_start, "timestamp_end": flow.request.timestamp_end, "is_replay": flow.request.is_replay, @@ -59,8 +59,8 @@ def convert_flow_to_json_dict(flow): "status_code": flow.response.status_code, "reason": flow.response.reason, "headers": tuple(flow.response.headers.items(True)), - "contentLength": len(flow.response.content) if flow.response.content is not None else None, - "contentHash": hashlib.sha256(flow.response.raw_content).hexdigest() if flow.response.content is not None else None, + "contentLength": len(flow.response.raw_content) if flow.response.raw_content is not None else None, + "contentHash": hashlib.sha256(flow.response.raw_content).hexdigest() if flow.response.raw_content is not None else None, "timestamp_start": flow.response.timestamp_start, "timestamp_end": flow.response.timestamp_end, "is_replay": flow.response.is_replay, @@ -304,11 +304,10 @@ class ReplayFlow(RequestHandler): class FlowContent(RequestHandler): def post(self, flow_id, message): - flow = self.flow - flow.backup() - message = getattr(flow, message) + self.flow.backup() + message = getattr(self.flow, message) message.content = self.request.files.values()[0][0].body - self.state.update_flow(flow) + self.state.update_flow(self.flow) def get(self, flow_id, message): message = getattr(self.flow, message) |