diff --git a/UPGRADE-5.0.md b/UPGRADE-5.0.md index 37d282710..6cb44b0f3 100644 --- a/UPGRADE-5.0.md +++ b/UPGRADE-5.0.md @@ -100,3 +100,17 @@ The following deprecated methods have been removed: ### EventType Changes The `metrics` event type has been removed from `EventType::cases()` as metrics are no longer supported. + +### Request Body Size Option Value Changed + +The `max_request_body_size` option value `'none'` has been renamed to `'never'` for consistency: + +```php +// Before (4.x) +$options->setMaxRequestBodySize('none'); + +// After (5.0) +$options->setMaxRequestBodySize('never'); +``` + +The allowed values for this option are now: `'never'`, `'small'`, `'medium'`, `'always'`. diff --git a/src/Integration/RequestIntegration.php b/src/Integration/RequestIntegration.php index 35ad426ae..3bffdc29c 100644 --- a/src/Integration/RequestIntegration.php +++ b/src/Integration/RequestIntegration.php @@ -275,7 +275,7 @@ private function isRequestBodySizeWithinReadBounds(int $requestBodySize, string return false; } - if ($maxRequestBodySize === 'none' || $maxRequestBodySize === 'never') { + if ($maxRequestBodySize === 'never') { return false; } diff --git a/src/Options.php b/src/Options.php index 2f62c6f9b..cfdc4e91f 100644 --- a/src/Options.php +++ b/src/Options.php @@ -963,7 +963,7 @@ private function configureOptions(OptionsResolver $resolver): void $resolver->setAllowedTypes('max_request_body_size', 'string'); $resolver->setAllowedTypes('class_serializers', 'array'); - $resolver->setAllowedValues('max_request_body_size', ['none', 'never', 'small', 'medium', 'always']); + $resolver->setAllowedValues('max_request_body_size', ['never', 'small', 'medium', 'always']); $resolver->setAllowedValues('dsn', \Closure::fromCallable([$this, 'validateDsnOption'])); $resolver->setAllowedValues('max_breadcrumbs', \Closure::fromCallable([$this, 'validateMaxBreadcrumbsOptions'])); $resolver->setAllowedValues('class_serializers', \Closure::fromCallable([$this, 'validateClassSerializersOption'])); diff --git a/tests/Integration/RequestIntegrationTest.php b/tests/Integration/RequestIntegrationTest.php index cea34cb57..66749155a 100644 --- a/tests/Integration/RequestIntegrationTest.php +++ b/tests/Integration/RequestIntegrationTest.php @@ -226,25 +226,6 @@ public static function invokeDataProvider(): iterable null, ]; - yield [ - [ - 'max_request_body_size' => 'none', - ], - (new ServerRequest('POST', 'http://www.example.com/foo')) - ->withHeader('Content-Length', '3') - ->withBody(Utils::streamFor('foo')), - [ - 'url' => 'http://www.example.com/foo', - 'method' => 'POST', - 'headers' => [ - 'Host' => ['www.example.com'], - 'Content-Length' => ['3'], - ], - ], - null, - null, - ]; - yield [ [ 'max_request_body_size' => 'never',