Patch for an Issue #286

This commit is contained in:
Miroslav Stampar 2013-01-17 14:17:39 +01:00
parent 65273295e3
commit a38b3e397c
2 changed files with 7 additions and 4 deletions

View File

@ -1128,7 +1128,8 @@ def parseTargetUrl():
conf.httpHeaders = filter(lambda (key, value): key != HTTPHEADER.HOST, conf.httpHeaders)
conf.httpHeaders.append((HTTPHEADER.HOST, getHostHeader(conf.url)))
kb.originalUrls[conf.url] = originalUrl
if conf.url != originalUrl:
kb.originalUrls[conf.url] = originalUrl
def expandAsteriskForColumns(expression):
"""

View File

@ -457,9 +457,11 @@ def _createTargetDirs():
conf.outputPath = tempDir
try:
with open(os.path.join(conf.outputPath, "target.txt"), "w+") as f:
_ = kb.originalUrls.get(conf.url) or conf.url or conf.hostname
f.write(_.encode(UNICODE_ENCODING))
with codecs.open(os.path.join(conf.outputPath, "target.txt"), "w+", UNICODE_ENCODING) as f:
f.write(kb.originalUrls.get(conf.url) or conf.url or conf.hostname)
f.write(" (%s)" % (HTTPMETHOD.POST if conf.data else HTTPMETHOD.GET))
if conf.data:
f.write("\n\n%s" % conf.data)
except IOError, ex:
if "denied" in str(ex):
errMsg = "you don't have enough permissions "