- Fixed a bug that would make certain sites end up in a infinite redirect loop

- HSTS headers now get deleted
This commit is contained in:
byt3bl33d3r 2015-03-13 18:37:16 +01:00
parent cb09a12164
commit 10468bfa5e
3 changed files with 7 additions and 4 deletions

View file

@ -190,7 +190,7 @@ class ClientRequest(Request):
def process(self): def process(self):
logging.debug("Resolving host: %s" % (self.getHeader('host'))) logging.debug("Resolving host: %s" % (self.getHeader('host')))
host = self.getHeader('host') host = self.getHeader('host')
if (self.hsts and host): if (self.hsts and host):
real = self.urlMonitor.real real = self.urlMonitor.real

View file

@ -125,15 +125,14 @@ class ServerConnection(HTTPClient):
self.isCompressed = True self.isCompressed = True
elif (key.lower()== 'strict-transport-security'): elif (key.lower()== 'strict-transport-security'):
value="max-age=0" logging.info("%s Zapped a strict-trasport-security header" % self.client.getClientIP())
logging.info("Zapped a strict-trasport-security header")
elif (key.lower() == 'content-length'): elif (key.lower() == 'content-length'):
self.contentLength = value self.contentLength = value
elif (key.lower() == 'set-cookie'): elif (key.lower() == 'set-cookie'):
self.client.responseHeaders.addRawHeader(key, value) self.client.responseHeaders.addRawHeader(key, value)
else: else:
self.client.setHeader(key, value) self.client.setHeader(key, value)

View file

@ -76,6 +76,10 @@ class URLMonitor:
method = url[0:methodIndex] method = url[0:methodIndex]
pathIndex = url.find("/", methodIndex) pathIndex = url.find("/", methodIndex)
if (pathIndex == -1):
pathIndex = len(url)
url += "/"
host = url[methodIndex:pathIndex].lower() host = url[methodIndex:pathIndex].lower()
path = url[pathIndex:] path = url[pathIndex:]