Skip to content

Commit 10bf01f

Browse files
committed
allow robots.txt on CDN
1 parent 68860ac commit 10bf01f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

wordpress-fail2ban/block-bad-requests/wp-login-bad-request.inc.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ private function check() {
108108
$server_name = isset( $_SERVER['SERVER_NAME'] ) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST'];
109109

110110
// block non-static requests from CDN
111-
if ( ! empty( $this->cdn_headers ) ) {
111+
// but allow robots.txt
112+
if ( ! empty( $this->cdn_headers ) && 'robots.txt' !== $request_path ) {
112113
$commons = array_intersect( $this->cdn_headers, array_keys( $_SERVER ) );
113114
if ( $commons === $this->cdn_headers ) {
114115
// workaround to prevent edge server banning

0 commit comments

Comments
 (0)