aboutsummaryrefslogtreecommitdiffstats
path: root/pathod/protocols/http.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@corte.si>2016-06-06 08:40:20 +1200
committerAldo Cortesi <aldo@corte.si>2016-06-06 08:40:20 +1200
commitc31b9c461dd4f905dcdb3f127c54d561a6166bb9 (patch)
tree2efbcfcbf0df6ef829cc191bfcfc5bfb9bb995b8 /pathod/protocols/http.py
parent435bfeca0b5c0f3a581e334bcfecc742d97d5e58 (diff)
parenta31c183a0fb19e68a3536f7fab55adbbaa1ce61c (diff)
downloadmitmproxy-c31b9c461dd4f905dcdb3f127c54d561a6166bb9.tar.gz
mitmproxy-c31b9c461dd4f905dcdb3f127c54d561a6166bb9.tar.bz2
mitmproxy-c31b9c461dd4f905dcdb3f127c54d561a6166bb9.zip
Merge pull request #1211 from cortesi/pathod
WIP: Radical webectomy of pathod
Diffstat (limited to 'pathod/protocols/http.py')
-rw-r--r--pathod/protocols/http.py25
1 files changed, 0 insertions, 25 deletions
diff --git a/pathod/protocols/http.py b/pathod/protocols/http.py
index d09b5bf2..6eefb34f 100644
--- a/pathod/protocols/http.py
+++ b/pathod/protocols/http.py
@@ -1,4 +1,3 @@
-from netlib import wsgi
from netlib.exceptions import TlsException
from netlib.http import http1
from .. import version, language
@@ -11,30 +10,6 @@ class HTTPProtocol(object):
def make_error_response(self, reason, body):
return language.http.make_error_response(reason, body)
- def handle_http_app(self, method, path, headers, body, lg):
- """
- Handle a request to the built-in app.
- """
- if self.pathod_handler.server.noweb:
- crafted = self.pathod_handler.make_http_error_response("Access Denied")
- language.serve(crafted, self.pathod_handler.wfile, self.pathod_handler.settings)
- return None, dict(
- type="error",
- msg="Access denied: web interface disabled"
- )
- lg("app: %s %s" % (method, path))
- req = wsgi.Request("http", method, path, b"HTTP/1.1", headers, body)
- flow = wsgi.Flow(self.pathod_handler.address, req)
- sn = self.pathod_handler.connection.getsockname()
- a = wsgi.WSGIAdaptor(
- self.pathod_handler.server.app,
- sn[0],
- self.pathod_handler.server.address.port,
- version.NAMEVERSION
- )
- a.serve(flow, self.pathod_handler.wfile)
- return self.pathod_handler.handle_http_request, None
-
def handle_http_connect(self, connect, lg):
"""
Handle a CONNECT request.