mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-07 05:01:30 +00:00
fix for Bug #202
This commit is contained in:
@@ -121,6 +121,9 @@ class Connect:
|
||||
|
||||
headers["Referer"] = "%s://%s" % (conf.scheme, conf.hostname)
|
||||
|
||||
if kb.authHeader:
|
||||
headers["Authorization"] = kb.authHeader
|
||||
|
||||
if auxHeaders:
|
||||
for key, item in auxHeaders.items():
|
||||
headers[key] = item
|
||||
@@ -140,10 +143,10 @@ class Connect:
|
||||
for _, cookie in enumerate(conf.cj):
|
||||
if not cookieStr:
|
||||
cookieStr = "Cookie: "
|
||||
|
||||
|
||||
cookie = getUnicode(cookie)
|
||||
index = cookie.index(" for ")
|
||||
|
||||
|
||||
cookieStr += "%s; " % cookie[8:index]
|
||||
|
||||
if not req.has_header("Cookie") and cookieStr:
|
||||
@@ -163,6 +166,9 @@ class Connect:
|
||||
|
||||
conn = urllib2.urlopen(req)
|
||||
|
||||
if req.has_header("Authorization"):
|
||||
kb.authHeader = req.headers["Authorization"]
|
||||
|
||||
if hasattr(conn, "redurl") and hasattr(conn, "redcode") and not conf.redirectHandled:
|
||||
msg = "sqlmap got a %d redirect to " % conn.redcode
|
||||
msg += "%s - What target address do you " % conn.redurl
|
||||
|
||||
Reference in New Issue
Block a user