@@ -318,13 +318,11 @@ def process(match, repl):
318318
319319 # Perform checks on header values
320320 if conf .httpHeaders :
321- for httpHeader , headerValue in conf .httpHeaders :
321+ for httpHeader , headerValue in list ( conf .httpHeaders ) :
322322 # Url encoding of the header values should be avoided
323323 # Reference: http://stackoverflow.com/questions/5085904/is-ok-to-urlencode-the-value-in-headerlocation-value
324324
325- httpHeader = httpHeader .title ()
326-
327- if httpHeader == HTTP_HEADER .USER_AGENT :
325+ if httpHeader .title () == HTTP_HEADER .USER_AGENT :
328326 conf .parameters [PLACE .USER_AGENT ] = urldecode (headerValue )
329327
330328 condition = any ((not conf .testParameter , intersect (conf .testParameter , USER_AGENT_ALIASES , True )))
@@ -333,7 +331,7 @@ def process(match, repl):
333331 conf .paramDict [PLACE .USER_AGENT ] = {PLACE .USER_AGENT : headerValue }
334332 testableParameters = True
335333
336- elif httpHeader == HTTP_HEADER .REFERER :
334+ elif httpHeader . title () == HTTP_HEADER .REFERER :
337335 conf .parameters [PLACE .REFERER ] = urldecode (headerValue )
338336
339337 condition = any ((not conf .testParameter , intersect (conf .testParameter , REFERER_ALIASES , True )))
@@ -342,7 +340,7 @@ def process(match, repl):
342340 conf .paramDict [PLACE .REFERER ] = {PLACE .REFERER : headerValue }
343341 testableParameters = True
344342
345- elif httpHeader == HTTP_HEADER .HOST :
343+ elif httpHeader . title () == HTTP_HEADER .HOST :
346344 conf .parameters [PLACE .HOST ] = urldecode (headerValue )
347345
348346 condition = any ((not conf .testParameter , intersect (conf .testParameter , HOST_ALIASES , True )))
@@ -351,6 +349,15 @@ def process(match, repl):
351349 conf .paramDict [PLACE .HOST ] = {PLACE .HOST : headerValue }
352350 testableParameters = True
353351
352+ else :
353+ condition = intersect (conf .testParameter , [httpHeader ], True )
354+
355+ if condition :
356+ conf .parameters [PLACE .CUSTOM_HEADER ] = str (conf .httpHeaders )
357+ conf .paramDict [PLACE .CUSTOM_HEADER ] = {httpHeader : "%s,%s%s" % (httpHeader , headerValue , CUSTOM_INJECTION_MARK_CHAR )}
358+ conf .httpHeaders = [(header , value .replace (CUSTOM_INJECTION_MARK_CHAR , "" )) for header , value in conf .httpHeaders ]
359+ testableParameters = True
360+
354361 if not conf .parameters :
355362 errMsg = "you did not provide any GET, POST and Cookie "
356363 errMsg += "parameter, neither an User-Agent, Referer or Host header value"
0 commit comments