mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-01-24 08:14:24 +03:00
bug fix for --code (previously redirecting codes where not considered)
This commit is contained in:
parent
77e630d89e
commit
1f7d87c6a4
|
@ -135,7 +135,7 @@ class Connect:
|
||||||
ignoreTimeout = kwargs.get('ignoreTimeout', kb.ignoreTimeout)
|
ignoreTimeout = kwargs.get('ignoreTimeout', kb.ignoreTimeout)
|
||||||
refreshing = kwargs.get('refreshing', False)
|
refreshing = kwargs.get('refreshing', False)
|
||||||
retrying = kwargs.get('retrying', False)
|
retrying = kwargs.get('retrying', False)
|
||||||
redirecting = kwargs.get('redirecting', False)
|
redirecting = kwargs.get('redirecting', None)
|
||||||
crawling = kwargs.get('crawling', False)
|
crawling = kwargs.get('crawling', False)
|
||||||
|
|
||||||
if not urlparse.urlsplit(url).netloc:
|
if not urlparse.urlsplit(url).netloc:
|
||||||
|
@ -309,7 +309,7 @@ class Connect:
|
||||||
kb.alwaysRedirect = choice not in ("n", "N")
|
kb.alwaysRedirect = choice not in ("n", "N")
|
||||||
|
|
||||||
kwargs['url'] = conn.redurl if kb.alwaysRedirect else conf.url
|
kwargs['url'] = conn.redurl if kb.alwaysRedirect else conf.url
|
||||||
kwargs['redirecting'] = True
|
kwargs['redirecting'] = conn.redcode
|
||||||
return Connect.__getPageProxy(**kwargs)
|
return Connect.__getPageProxy(**kwargs)
|
||||||
|
|
||||||
# Return response object
|
# Return response object
|
||||||
|
@ -318,7 +318,7 @@ class Connect:
|
||||||
|
|
||||||
# Get HTTP response
|
# Get HTTP response
|
||||||
page = conn.read()
|
page = conn.read()
|
||||||
code = conn.code
|
code = redirecting or conn.code
|
||||||
responseHeaders = conn.info()
|
responseHeaders = conn.info()
|
||||||
responseHeaders[URI_HTTP_HEADER] = conn.geturl()
|
responseHeaders[URI_HTTP_HEADER] = conn.geturl()
|
||||||
page = decodePage(page, responseHeaders.get(HTTPHEADER.CONTENT_ENCODING), responseHeaders.get(HTTPHEADER.CONTENT_TYPE))
|
page = decodePage(page, responseHeaders.get(HTTPHEADER.CONTENT_ENCODING), responseHeaders.get(HTTPHEADER.CONTENT_TYPE))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user