mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-04 19:50:17 +00:00
GHA workflow - Fix Test 1 [skip travis]
This commit is contained in:
parent
b2ae78b92a
commit
90ff2cefe7
1 changed files with 8 additions and 4 deletions
|
@ -41,6 +41,10 @@
|
||||||
# SOFTWARE.
|
# SOFTWARE.
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -o pipefail
|
||||||
|
export TERM=xterm
|
||||||
|
|
||||||
# -------------------------------------------
|
# -------------------------------------------
|
||||||
# For Testing REGEX and False Positives Cases
|
# For Testing REGEX and False Positives Cases
|
||||||
# -------------------------------------------
|
# -------------------------------------------
|
||||||
|
@ -125,7 +129,7 @@ UAtest_mustmatch () {
|
||||||
for mustmatch in "${UAmustmatch[@]}"
|
for mustmatch in "${UAmustmatch[@]}"
|
||||||
do
|
do
|
||||||
if
|
if
|
||||||
curl -A "${mustmatch}" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
curl -A "${mustmatch}" http://localhost:80 2>&1 | grep -i '(52)'; then
|
||||||
echo "${bold}${green}PASSED - ${red}${mustmatch} was ${bold}${red}BLOCKED"
|
echo "${bold}${green}PASSED - ${red}${mustmatch} was ${bold}${red}BLOCKED"
|
||||||
else
|
else
|
||||||
echo "${bold}${red}FAILED - ${red}${mustmatch} was ${bold}${red}NOT BLOCKED"
|
echo "${bold}${red}FAILED - ${red}${mustmatch} was ${bold}${red}NOT BLOCKED"
|
||||||
|
@ -138,7 +142,7 @@ UAtest_mustnotmatch () {
|
||||||
for mustnotmatch in "${UAmustnotmatch[@]}"
|
for mustnotmatch in "${UAmustnotmatch[@]}"
|
||||||
do
|
do
|
||||||
if
|
if
|
||||||
curl -A "${mustnotmatch}" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
curl -A "${mustnotmatch}" http://localhost:80 2>&1 | grep -i '(52)'; then
|
||||||
echo "${bold}${red}FAILED (FALSE POSITIVE DETECTED) - ${bold}${red}${mustnotmatch}"
|
echo "${bold}${red}FAILED (FALSE POSITIVE DETECTED) - ${bold}${red}${mustnotmatch}"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
|
@ -155,7 +159,7 @@ REFtest_mustmatch () {
|
||||||
for mustmatch in "${REFmustmatch[@]}"
|
for mustmatch in "${REFmustmatch[@]}"
|
||||||
do
|
do
|
||||||
if
|
if
|
||||||
curl -I http://localhost:9000 -e "${mustmatch}" 2>&1 | grep -i '(52)'; then
|
curl -I http://localhost:80 -e "${mustmatch}" 2>&1 | grep -i '(52)'; then
|
||||||
echo "${bold}${green}PASSED - ${red}${mustmatch} was ${bold}${red}BLOCKED"
|
echo "${bold}${green}PASSED - ${red}${mustmatch} was ${bold}${red}BLOCKED"
|
||||||
else
|
else
|
||||||
echo "${bold}${red}FAILED - ${red}${mustmatch} was ${bold}${red}NOT BLOCKED"
|
echo "${bold}${red}FAILED - ${red}${mustmatch} was ${bold}${red}NOT BLOCKED"
|
||||||
|
@ -168,7 +172,7 @@ REFtest_mustnotmatch () {
|
||||||
for mustnotmatch in "${REFmustnotmatch[@]}"
|
for mustnotmatch in "${REFmustnotmatch[@]}"
|
||||||
do
|
do
|
||||||
if
|
if
|
||||||
curl -I http://localhost:9000 -e "${mustnotmatch}" 2>&1 | grep -i '(52)'; then
|
curl -I http://localhost:80 -e "${mustnotmatch}" 2>&1 | grep -i '(52)'; then
|
||||||
echo "${bold}${red}FAILED (FALSE POSITIVE DETECTED) - ${bold}${red}${mustnotmatch}"
|
echo "${bold}${red}FAILED (FALSE POSITIVE DETECTED) - ${bold}${red}${mustnotmatch}"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Reference in a new issue