Skip to content

Commit f132937

Browse files
fix(log): Fix log messages for captcha workflow
1 parent d0db1b0 commit f132937

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ The public API of this library consists of all public or protected methods, prop
1111

1212
---
1313

14+
## [1.1.1](https://github.com/crowdsecurity/php-cs-bouncer/releases/tag/v1.1.1) - 2023-02-16
15+
[_Compare with previous release_](https://github.com/crowdsecurity/php-cs-bouncer/compare/v1.1.0...v1.1.1)
16+
17+
### Fixed
18+
- Fix log messages for captcha remediation
19+
20+
---
21+
1422
## [1.1.0](https://github.com/crowdsecurity/php-cs-bouncer/releases/tag/v1.1.0) - 2023-02-16
1523
[_Compare with previous release_](https://github.com/crowdsecurity/php-cs-bouncer/compare/v1.0.1...v1.1.0)
1624

src/AbstractBouncer.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,6 @@ protected function handleRemediation(string $remediation, string $ip): void
359359
{
360360
switch ($remediation) {
361361
case Constants::REMEDIATION_CAPTCHA:
362-
$this->logger->debug('Will display a captcha wall', [
363-
'ip' => $ip,
364-
]);
365362
$this->handleCaptchaRemediation($ip);
366363
break;
367364
case Constants::REMEDIATION_BAN:
@@ -639,8 +636,14 @@ private function handleCaptchaRemediation(string $ip): void
639636

640637
// Display captcha page if this is required.
641638
if ($cachedCaptchaVariables['has_to_be_resolved'] || $mustResolve) {
639+
$this->logger->debug('Will display a captcha wall', [
640+
'ip' => $ip,
641+
]);
642642
$this->displayCaptchaWall($ip);
643643
}
644+
$this->logger->info('Captcha wall is not required (already solved)', [
645+
'ip' => $ip,
646+
]);
644647
}
645648

646649
/**

src/Constants.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class Constants extends RemConstants
3939
/** @var string Path for html templates folder (e.g. ban and captcha wall) */
4040
public const TEMPLATES_DIR = __DIR__ . "/templates";
4141
/** @var string The last version of this library */
42-
public const VERSION = 'v1.1.0';
42+
public const VERSION = 'v1.1.1';
4343
/** @var string The "disabled" x-forwarded-for setting */
4444
public const X_FORWARDED_DISABLED = 'no_forward';
4545
}

0 commit comments

Comments
 (0)