mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 04:31:30 +00:00
Trivial updates
This commit is contained in:
@@ -243,7 +243,11 @@ def checkCharEncoding(encoding, warn=True):
|
||||
def getHeuristicCharEncoding(page):
|
||||
"""
|
||||
Returns page encoding charset detected by usage of heuristics
|
||||
Reference: http://chardet.feedparser.org/docs/
|
||||
|
||||
Reference: https://chardet.readthedocs.io/en/latest/usage.html
|
||||
|
||||
>>> getHeuristicCharEncoding(b"<html></html>")
|
||||
'ascii'
|
||||
"""
|
||||
|
||||
key = hash(page)
|
||||
@@ -259,6 +263,9 @@ def getHeuristicCharEncoding(page):
|
||||
def decodePage(page, contentEncoding, contentType):
|
||||
"""
|
||||
Decode compressed/charset HTTP response
|
||||
|
||||
>>> getText(decodePage(b"<html>foo&bar</html>", None, "text/html; charset=utf-8"))
|
||||
'<html>foo&bar</html>'
|
||||
"""
|
||||
|
||||
if not page or (conf.nullConnection and len(page) < 2):
|
||||
|
||||
Reference in New Issue
Block a user