File tree Expand file tree Collapse file tree 3 files changed +18
-12
lines changed Expand file tree Collapse file tree 3 files changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/)
55and this project adheres to [ Semantic Versioning] ( http://semver.org/spec/v2.0.0.html ) .
66
77
8+ ## [ 0.33.0] ( https://github.com/crowdsecurity/php-cs-bouncer/releases/tag/v0.33.0 ) - 2022-11-10
9+ [ _ Compare with previous release_ ] ( https://github.com/crowdsecurity/php-cs-bouncer/compare/v0.32.0...v0.33.0 )
10+
11+ ### Fixed
12+ - In stream mode, a clean IP decision (` bypass ` ) was not cached at all. The decision is now cached for ten years as expected.
13+
14+ ---
15+
816## [ 0.32.0] ( https://github.com/crowdsecurity/php-cs-bouncer/releases/tag/v0.32.0 ) - 2022-09-29
917[ _ Compare with previous release_ ] ( https://github.com/crowdsecurity/php-cs-bouncer/compare/v0.31.0...v0.32.0 )
1018
Original file line number Diff line number Diff line change @@ -339,17 +339,15 @@ protected function defferUpdateCacheConfig(array $config): void
339339 protected function formatRemediationFromDecision (?array $ decision ): array
340340 {
341341 if (!$ decision ) {
342- $ duration = time () + $ this ->cacheExpirationForCleanIp ;
343- if ($ this ->streamMode ) {
344- /**
345- * In stream mode we consider a clean IP forever... until the next resync.
346- * in this case, forever is 10 years as PHP_INT_MAX will cause trouble with the Memcached Adapter
347- * (int to float unwanted conversion)
348- * */
349- $ duration = 315360000 ;
350- }
351-
352- return [Constants::REMEDIATION_BYPASS , $ duration , 0 ];
342+ /**
343+ * In stream mode we consider a clean IP forever... until the next resync.
344+ * in this case, forever is 10 years as PHP_INT_MAX will cause trouble with the Memcached Adapter
345+ * (int to float unwanted conversion)
346+ *
347+ */
348+ $ duration = $ this ->streamMode ? 315360000 : $ this ->cacheExpirationForCleanIp ;
349+
350+ return [Constants::REMEDIATION_BYPASS , time () + $ duration , 0 ];
353351 }
354352
355353 $ duration = self ::parseDurationToSeconds ($ decision ['duration ' ]);
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ class Constants
7676 /** @var string Path for html templates folder (e.g. ban and captcha wall) */
7777 public const TEMPLATES_DIR = __DIR__ . "/templates " ;
7878 /** @var string The last version of this library */
79- public const VERSION = 'v0.32 .0 ' ;
79+ public const VERSION = 'v0.33 .0 ' ;
8080 /** @var string The "disabled" x-forwarded-for setting */
8181 public const X_FORWARDED_DISABLED = 'no_forward ' ;
8282}
You can’t perform that action at this time.
0 commit comments