Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor ProxyHandler #189

Merged
merged 2 commits into from
Dec 13, 2013
Merged

Refactor ProxyHandler #189

merged 2 commits into from
Dec 13, 2013

Conversation

mhils
Copy link
Member

@mhils mhils commented Dec 10, 2013

This PR refactors ProxyHandler.read_request and its submethods to remove duplicate code and clearly separate request processing. As this is pretty much the core of mitmproxy, I'd love to have a second opinion on it. The github diff is pretty much useless, reading the new proxy.py lines 337-450 gives a better picture of the changes (old proxy.py here). If there are no objections, please merge.

By the way, this restructuring unfolded a few caveats, namely processing absolute-form request targets in reverse proxy or transparent mode. mitmproxy fails to do that correctly at the moment. In other words, this breaks a client -> transparent mitmproxy -> other proxy -> destination setup. However, that is a separate issue not introduced by these changes.

Cheers,
Max

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 21de99c on refactor_proxyhandler into 2be19a5 on master.

@cortesi
Copy link
Member

cortesi commented Dec 13, 2013

This looks good to me. Lets merge, and see if anything breaks.

cortesi added a commit that referenced this pull request Dec 13, 2013
@cortesi cortesi merged commit 224cd41 into master Dec 13, 2013
@mhils mhils deleted the refactor_proxyhandler branch December 15, 2013 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants