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

Skip to content

Commit 2efee05

Browse files
committed
Major enhancement in comparison algorithm
1 parent 9544170 commit 2efee05

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/request/comparison.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ def comparison(page, headers=None, getSeqMatcher=False):
7979
# If the url is stable and we did not set yet the match ratio and the
8080
# current injected value changes the url page content
8181
if MATCH_RATIO == None:
82-
if conf.md5hash != None and ratio != 1:
83-
logger.debug("Setting match ratio to %.3f" % ratio)
82+
if conf.md5hash != None and ratio < 1 and ratio > 0.6:
83+
logger.debug("setting match ratio to %.3f" % ratio)
8484
MATCH_RATIO = ratio
85-
elif conf.md5hash == None:
86-
logger.debug("Setting match ratio to default value 0.900")
85+
elif conf.md5hash == None or ( conf.md5hash != None and ratio < 0.6 ):
86+
logger.debug("setting match ratio to default value 0.900")
8787
MATCH_RATIO = 0.900
8888

8989
# If it has been requested to return the ratio and not a comparison

0 commit comments

Comments
 (0)