Skip to content

Sentry can't detect errors if a request body size is zero #1118

Description

@Bziks

Sentry can't detect errors if a request body size is zero.
Example:

do {
    try {
        abs();
    } catch (Throwable $e) {
        $s .= str_repeat('*', 1e3);
    }
} while (++$i < 1e6);

I get an error "Allowed memory size..."

I found place, where can I fix it, class RequestIntegration:

if (
    null === $requestBodySize ||
>>>    0 === $requestBodySize ||   <<<
    'none' === $maxRequestBodySize ||
    ('small' === $maxRequestBodySize && $requestBodySize > self::REQUEST_BODY_SMALL_MAX_CONTENT_LENGTH) ||
    ('medium' === $maxRequestBodySize && $requestBodySize > self::REQUEST_BODY_MEDIUM_MAX_CONTENT_LENGTH)
) {
    return null;
}

Probably you add this small fix in the next release?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions