@@ -493,8 +493,6 @@ def __setHTTPProxy():
493493 if not conf .proxy :
494494 return
495495
496- parseTargetUrl ()
497-
498496 debugMsg = "setting the HTTP proxy to pass by all HTTP requests"
499497 logger .debug (debugMsg )
500498
@@ -516,8 +514,8 @@ def __setHTTPProxy():
516514
517515 # Workaround for http://bugs.python.org/issue1424152 (urllib/urllib2:
518516 # HTTPS over (Squid) Proxy fails) as long as HTTP over SSL requests
519- # can't be tunneled over an HTTP proxy natively by Python urllib2
520- # standard library
517+ # can't be tunneled over an HTTP proxy natively by Python (<= 2.5)
518+ # urllib2 standard library
521519 if conf .scheme == "https" :
522520 proxyHandler = ProxyHTTPSHandler (__proxyString )
523521 else :
@@ -545,8 +543,6 @@ def __setHTTPAuthentication():
545543 errMsg += "but did not provide the type"
546544 raise sqlmapSyntaxException , errMsg
547545
548- parseTargetUrl ()
549-
550546 debugMsg = "setting the HTTP Authentication type and credentials"
551547 logger .debug (debugMsg )
552548
@@ -599,9 +595,8 @@ def __setHTTPMethod():
599595
600596
601597def __setHTTPExtraHeaders ():
602- parseTargetUrl ()
603-
604- conf .httpHeaders .append (("Host" , conf .hostname ))
598+ if conf .hostname :
599+ conf .httpHeaders .append (("Host" , conf .hostname ))
605600
606601 if conf .headers :
607602 debugMsg = "setting extra HTTP headers"
@@ -987,6 +982,9 @@ def init(inputOptions=advancedDict()):
987982 __setConfAttributes ()
988983 __setKnowledgeBaseAttributes ()
989984 __cleanupOptions ()
985+
986+ parseTargetUrl ()
987+
990988 __setHTTPTimeout ()
991989 __setHTTPCookies ()
992990 __setHTTPReferer ()
0 commit comments