kopia lustrzana https://github.com/dgtlmoon/changedetection.io
Ensure string matching on the ignore filter is always case-INsensitive
rodzic
014fda9058
commit
b401998030
|
@ -140,7 +140,7 @@ def strip_ignore_text(content, wordlist, mode="content"):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if not regex_matches and not any(skip_text in line for skip_text in ignore):
|
if not regex_matches and not any(skip_text.lower() in line.lower() for skip_text in ignore):
|
||||||
output.append(line.encode('utf8'))
|
output.append(line.encode('utf8'))
|
||||||
else:
|
else:
|
||||||
ignored_line_numbers.append(i)
|
ignored_line_numbers.append(i)
|
||||||
|
|
|
@ -70,7 +70,7 @@ def set_modified_ignore_response():
|
||||||
<body>
|
<body>
|
||||||
Some initial text</br>
|
Some initial text</br>
|
||||||
<p>Which is across multiple lines</p>
|
<p>Which is across multiple lines</p>
|
||||||
<P>ZZZZZ</P>
|
<P>ZZZZz</P>
|
||||||
</br>
|
</br>
|
||||||
So let's see what happens. </br>
|
So let's see what happens. </br>
|
||||||
</body>
|
</body>
|
||||||
|
@ -85,7 +85,8 @@ def set_modified_ignore_response():
|
||||||
def test_check_ignore_text_functionality(client, live_server):
|
def test_check_ignore_text_functionality(client, live_server):
|
||||||
sleep_time_for_fetch_thread = 3
|
sleep_time_for_fetch_thread = 3
|
||||||
|
|
||||||
ignore_text = "XXXXX\r\nYYYYY\r\nZZZZZ\r\nnew ignore stuff"
|
# Use a mix of case in ZzZ to prove it works case-insensitive.
|
||||||
|
ignore_text = "XXXXX\r\nYYYYY\r\nzZzZZ\r\nnew ignore stuff"
|
||||||
set_original_ignore_response()
|
set_original_ignore_response()
|
||||||
|
|
||||||
# Give the endpoint time to spin up
|
# Give the endpoint time to spin up
|
||||||
|
|
Ładowanie…
Reference in New Issue