mitmproxy/mitmproxy — pull request #347 by mhils (2014-09-05 23:19:45+00:00)
Title: Remove BackReferenceMixin

This PR removes the backreference from the request to the flow (`request.flow`). This clarifies the relationship between HTTPFlow and HTTPRequest - many functions that accepted a request before actually required more information and used the `.flow` attribute as some kind of workaround. Operating mainly on the Flow reflects the present behaviour of the State, HTTPHandler and inline scripts.

- Flows are treated as the main container and passed to handle_request, handle_response etc.
- As a direct consequence the `.reply` attribute is now on the Flow, not on request and response. This breaks a few heuristics on the ConsoleView, which have been adjusted.
- Most changes have been done in the tests - `tutils.treq()` only returns an isolated request now whereas `tutils.tflow()` is now the appropriate function for most cases.
- As an ugly workaround, `.get_url()` etc on the HTTPRequest now require a flow parameter. This is temporary and mitigated by #342.