Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 08e0eb9

Browse files
committed
minor lower/upper case fix
1 parent 9be8942 commit 08e0eb9

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

lib/controller/controller.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,12 @@ def start():
394394
# Test Cookie header only if --level >= 2
395395
skip |= (place == PLACE.COOKIE and conf.level < 2)
396396

397-
skip &= not (place == PLACE.UA and intersect(USER_AGENT_ALIASES, conf.testParameter))
398-
skip &= not (place == PLACE.REFERER and intersect(REFERER_ALIASES, conf.testParameter))
397+
skip |= (place == PLACE.UA and intersect(USER_AGENT_ALIASES, conf.skip, True) not in ([], None))
398+
skip |= (place == PLACE.REFERER and intersect(REFERER_ALIASES, conf.skip, True) not in ([], None))
399+
skip |= (place == PLACE.COOKIE and intersect('cookie', conf.skip, True) not in ([], None))
400+
401+
skip &= not (place == PLACE.UA and intersect(USER_AGENT_ALIASES, conf.testParameter, True))
402+
skip &= not (place == PLACE.REFERER and intersect(REFERER_ALIASES, conf.testParameter, True))
399403

400404
if skip:
401405
continue

lib/core/common.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2679,15 +2679,22 @@ def getExceptionFrameLocals():
26792679

26802680
return retVal
26812681

2682-
def intersect(valueA, valueB):
2682+
def intersect(valueA, valueB, lowerCase=False):
26832683
"""
26842684
Returns intersection of the array-ized values
26852685
"""
26862686

26872687
retVal = None
26882688

26892689
if valueA and valueB:
2690-
retVal = [val for val in arrayizeValue(valueA) if val in arrayizeValue(valueB)]
2690+
valueA = arrayizeValue(valueA)
2691+
valueB = arrayizeValue(valueB)
2692+
2693+
if lowerCase:
2694+
valueA = [val.lower() if isinstance(val, basestring) else val for val in valueA]
2695+
valueB = [val.lower() if isinstance(val, basestring) else val for val in valueB]
2696+
2697+
retVal = [val for val in valueA if val in valueB]
26912698

26922699
return retVal
26932700

0 commit comments

Comments
 (0)