Fix _normalizeURI substitution. Fix _normalizeParameters. Fix -r argument

This commit is contained in:
Gregory Soutade 2016-01-03 09:28:19 +01:00
parent 73e4b0d8a6
commit ec0a3a52a8

View File

@ -337,7 +337,7 @@ class IWLA(object):
def _normalizeURI(self, uri):
if uri == '/': return uri
uri = self.normalize_uri_final_slashes.sub('', uri)
uri = self.normalize_uri_final_slashes.sub('/', uri)
return uri
def _normalizeParameters(self, parameters):
@ -367,7 +367,9 @@ class IWLA(object):
if hit['http_referer']:
referer_groups = self.uri_re.match(hit['http_referer'])
if referer_groups:
hit['extract_referer'] = self._normalizeURI(referer_groups.groupdict())
hit['extract_referer'] = referer_groups.groupdict()
hit['extract_referer']['extract_uri'] = self._normalizeURI(hit['extract_referer']['extract_uri'])
hit['extract_referer']['extract_parameters'] = self._normalizeParameters(hit['extract_referer']['extract_parameters'])
return True
def _decodeTime(self, hit):
@ -817,7 +819,7 @@ if __name__ == '__main__':
default='INFO', type=str,
help='Loglevel in %s, default : %s' % (['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'], 'INFO'))
parser.add_argument('-r', '--reset', dest='reset', action='store_true',
parser.add_argument('-r', '--reset', dest='reset',
default=False,
help='Reset analysis to a specific date (month/year)')