This commit is contained in:
Miroslav Stampar
2019-03-25 11:17:25 +01:00
parent 9dcd18e41c
commit 9387a005e3
2 changed files with 3 additions and 3 deletions

View File

@@ -1148,14 +1148,14 @@ def _setSafeVisit():
checkFile(conf.safeReqFile)
raw = readCachedFileContent(conf.safeReqFile)
match = re.search(r"\A([A-Z]+) ([^ ]+) HTTP/[0-9.]+\Z", raw[:raw.find('\n')])
match = re.search(r"\A([A-Z]+) ([^ ]+) HTTP/[0-9.]+\Z", raw.split('\n')[0].strip())
if match:
kb.safeReq.method = match.group(1)
kb.safeReq.url = match.group(2)
kb.safeReq.headers = {}
for line in raw[raw.find('\n') + 1:].split('\n'):
for line in raw.split('\n')[1:]:
line = line.strip()
if line and ':' in line:
key, value = line.split(':', 1)