# # # QS_ClientIpFromHeader X-Hash # QS_ClientEventLimitCount 3 2 QS_Hash # # RequestHeaderPlus unset X-Hash # SetEnvIfPlus Authorization "^Basic (.*)" myhash=$1 # SetHashHeaderPlus X-Hash myhash # SetEnvIfPlus User-Agent ^HASH QS_Hash=1 # INCLUDE scripts/ports EXEC ./ctl.sh restart -D SetHashHeaderPlus >/dev/null CLIENT _LOOP 2 _REQ localhost $QS_PORT_BASE __GET /index.html HTTP/1.1 __Host: localhost __User-Agent: HASH __Authorization: Basic cGJ1Y2hiaW5kZXI6MTIzNDU2Nzg= __ _EXPECT . "this is the root index.html" _WAIT _CLOSE _END LOOP _REQ localhost $QS_PORT_BASE __GET /htt/limit/index.html HTTP/1.1 __Host: localhost __Connection: keep-alive __User-Agent: HASH __Authorization: Basic cGJ1Y2hiaW5kZXI6MTIzNDU2Nzg= __ _EXPECT . "!this is the root index.html" _EXPECT . "code=067" _EXPECT . "custom error page" _WAIT _CLOSE _SLEEP 200 _EXPECT EXEC "mod_qos\(067\): access denied, QS_ClientEventLimitCount rule: event=QS_Hash, max=3, current=3, age=., c=5d66:40d1:8685:d164:7dd0:7f56:bde5:028c" _EXEC tail -1 logs/error_log _LOOP 2 _REQ localhost $QS_PORT_BASE __GET /index.html HTTP/1.1 __Host: localhost __User-Agent: HASH __Authorization: Basic dXNlcjI6MTIzNA== __ _EXPECT . "this is the root index.html" _WAIT _CLOSE _END LOOP _REQ localhost $QS_PORT_BASE __GET /htt/limit/index.html HTTP/1.1 __Host: localhost __Connection: keep-alive __User-Agent: HASH __Authorization: Basic dXNlcjI6MTIzNA== __ _EXPECT . "!this is the root index.html" _EXPECT . "code=067" _EXPECT . "custom error page" _WAIT _CLOSE _SLEEP 200 _EXPECT EXEC "mod_qos\(067\): access denied, QS_ClientEventLimitCount rule: event=QS_Hash, max=3, current=3, age=., c=08b1:b7d8:b9a4:07a5:0c4e:5161:5df2:fba1" _EXEC tail -1 logs/error_log _REQ localhost $QS_PORT_BASE __GET /index.html HTTP/1.1 __Host: localhost __User-Agent: HASH __Authorization: Basic Zm9vOjEyMzQ0NTU2Njc3ODg= __ _EXPECT . "this is the root index.html" _WAIT _CLOSE _SLEEP 2500 _REQ localhost $QS_PORT_BASE __GET /index.html HTTP/1.1 __Host: localhost __User-Agent: HASH __Authorization: Basic cGJ1Y2hiaW5kZXI6MTIzNDU2Nzg= __ _EXPECT . "this is the root index.html" _WAIT _CLOSE END BLOCK FINALLY _EXEC ./ctl.sh restart 2>/dev/null 1>/dev/null END