@@ -914,12 +914,6 @@ class _(dict):
914914 raise SqlmapConnectionException (warnMsg )
915915
916916 finally :
917- if isinstance (page , six .binary_type ):
918- if HTTP_HEADER .CONTENT_TYPE in (responseHeaders or {}) and not re .search (TEXT_CONTENT_TYPE_REGEX , responseHeaders [HTTP_HEADER .CONTENT_TYPE ]):
919- page = six .text_type (page , errors = "ignore" )
920- else :
921- page = getUnicode (page )
922-
923917 for function in kb .postprocessFunctions :
924918 try :
925919 page , responseHeaders , code = function (page , responseHeaders , code )
@@ -928,6 +922,12 @@ class _(dict):
928922 errMsg += "function '%s' ('%s')" % (function .__name__ , getSafeExString (ex ))
929923 raise SqlmapGenericException (errMsg )
930924
925+ if isinstance (page , six .binary_type ):
926+ if HTTP_HEADER .CONTENT_TYPE in (responseHeaders or {}) and not re .search (TEXT_CONTENT_TYPE_REGEX , responseHeaders [HTTP_HEADER .CONTENT_TYPE ]):
927+ page = six .text_type (page , errors = "ignore" )
928+ else :
929+ page = getUnicode (page )
930+
931931 for _ in (getattr (conn , "redcode" , None ), code ):
932932 if _ is not None and _ in conf .abortCode :
933933 errMsg = "aborting due to detected HTTP code '%d'" % _
0 commit comments