Skip to content

Commit

Permalink
work around links with missing path by assuming a path of /
Browse files Browse the repository at this point in the history
  • Loading branch information
noxxi committed Mar 16, 2018
1 parent 8dac387 commit 575f886
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions sslstrip/URLMonitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,13 @@ def addSecureLink(self, client, url):
method = url[0:methodIndex]

pathIndex = url.find("/", methodIndex)
host = url[methodIndex:pathIndex]
path = url[pathIndex:]
if pathIndex == -1:
# invalid URL, missing path, assume '/'
host = url[methodIndex:]
path = '/'
else:
host = url[methodIndex:pathIndex]
path = url[pathIndex:]

port = 443
portIndex = host.find(":")
Expand Down

0 comments on commit 575f886

Please sign in to comment.