Skip to content

Commit

Permalink
fix: Added support for non proxy-aware clients.
Browse files Browse the repository at this point in the history
  • Loading branch information
DoZ10 committed Jan 30, 2017
1 parent 0f79a2f commit a3906a3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions intercepting_proxy.py
Expand Up @@ -172,6 +172,10 @@ def serve_resource(self):
def process(self):
host = None
port = None

if not self.uri.startswith("http://") and not self.uri.startswith("https://"):
self.uri = "http://" + self.getHeader("Host") + self.uri

parsed_uri = urlparse(self.uri)
self.uri = urlunparse(('', '', parsed_uri.path, parsed_uri.params, parsed_uri.query, parsed_uri.fragment)) or "/"

Expand Down

0 comments on commit a3906a3

Please sign in to comment.