Skip to content

Commit ff2bffb

Browse files
committed
Merge pull request #5 from Timandes/master
Throw ForbiddenException when client is not in server's listen.allowed_clients.
2 parents be26b09 + e705e0b commit ff2bffb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Adoy/FastCGI/Client.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace Adoy\FastCGI;
1111

1212
class TimedOutException extends \Exception {}
13+
class ForbiddenException extends \Exception {}
1314

1415
/**
1516
* Handles communication with a FastCGI application
@@ -547,6 +548,12 @@ public function wait_for_response($requestId, $timeoutMs = 0) {
547548
throw new TimedOutException('Read timed out');
548549
}
549550

551+
if ($info['unread_bytes'] == 0
552+
&& $info['blocked']
553+
&& $info['eof']) {
554+
throw new ForbiddenException('Not in white list. Check listen.allowed_clients.');
555+
}
556+
550557
throw new \Exception('Read failed');
551558
}
552559

0 commit comments

Comments
 (0)