Skip to content

Retrofit logger StringIndexOutOfBoundsException when truncating request body #60

@oktaeri

Description

@oktaeri

Bug

When body.contentLength() exceeds maxLoggableRequestSize, the code attempts to truncate bodyString. This fails when the actual bodyString.length() is less than the maxLoggableRequestSize.

Fix

Check bodyString length instead of body.contentLength().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions