()
Initialize target environment.
Initialize target environment.
Initialize target environment .
def initTargetEnv():
    """
    Initialize target environment.
    """

    if conf.multipleTargets:
        if conf.hashDB:
            conf.hashDB.close()

        if conf.cj:
            resetCookieJar(conf.cj)

        conf.paramDict = {}
        conf.parameters = {}
        conf.hashDBFile = None

        _setKnowledgeBaseAttributes(False)
        _restoreMergedOptions()
        _setDBMS()

    if conf.data:
        class _(unicode):
            pass

        kb.postUrlEncode = True

        for key, value in conf.httpHeaders:
            if key.upper() == HTTP_HEADER.CONTENT_TYPE.upper():
                kb.postUrlEncode = "urlencoded" in value
                break

        if kb.postUrlEncode:
            original = conf.data
            conf.data = _(urldecode(conf.data))
            setattr(conf.data, UNENCODED_ORIGINAL_VALUE, original)
            kb.postSpaceToPlus = '+' in original
def initTargetEnv ( ) : if conf . multipleTargets : if conf . hashDB : conf . hashDB . close ( ) if conf . cj : resetCookieJar ( conf . cj ) conf . paramDict = { } conf . parameters = { } conf . hashDBFile = None _setKnowledgeBaseAttributes ( False ) _restoreMergedOptions ( ) _setDBMS ( ) if conf . data : class _ ( unicode ) : pass kb . postUrlEncode = True for key , value in conf . httpHeaders : if key . upper ( ) == HTTP_HEADER . CONTENT_TYPE . upper ( ) : kb . postUrlEncode = "urlencoded" in value break if kb . postUrlEncode : original = conf . data conf . data = _ ( urldecode ( conf . data ) ) setattr ( conf . data , UNENCODED_ORIGINAL_VALUE , original ) kb . postSpaceToPlus = '+' in original