Skip to content

Commit a38b3e3

Browse files
committed
Patch for an Issue #286
1 parent 6527329 commit a38b3e3

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Diff for: lib/core/common.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,8 @@ def parseTargetUrl():
11281128
conf.httpHeaders = filter(lambda (key, value): key != HTTPHEADER.HOST, conf.httpHeaders)
11291129
conf.httpHeaders.append((HTTPHEADER.HOST, getHostHeader(conf.url)))
11301130

1131-
kb.originalUrls[conf.url] = originalUrl
1131+
if conf.url != originalUrl:
1132+
kb.originalUrls[conf.url] = originalUrl
11321133

11331134
def expandAsteriskForColumns(expression):
11341135
"""

Diff for: lib/core/target.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -457,9 +457,11 @@ def _createTargetDirs():
457457
conf.outputPath = tempDir
458458

459459
try:
460-
with open(os.path.join(conf.outputPath, "target.txt"), "w+") as f:
461-
_ = kb.originalUrls.get(conf.url) or conf.url or conf.hostname
462-
f.write(_.encode(UNICODE_ENCODING))
460+
with codecs.open(os.path.join(conf.outputPath, "target.txt"), "w+", UNICODE_ENCODING) as f:
461+
f.write(kb.originalUrls.get(conf.url) or conf.url or conf.hostname)
462+
f.write(" (%s)" % (HTTPMETHOD.POST if conf.data else HTTPMETHOD.GET))
463+
if conf.data:
464+
f.write("\n\n%s" % conf.data)
463465
except IOError, ex:
464466
if "denied" in str(ex):
465467
errMsg = "you don't have enough permissions "

0 commit comments

Comments
 (0)