Skip to content

Method skipPaths on builder does not work as expected #1237

@mikegr

Description

@mikegr

✍️ Describe the bug

Using skipPaths does not work as expected. When using the builder the path is added by using the addPathSegment method on the HttpUrl.Builder, which will escape any slash to %F2. You should use the addPathSegments to allow a full path. Because later the full "encodedPath" of the request url is used to compare.

See line
https://github.com/ChuckerTeam/chucker/blob/main/library/src/main/kotlin/com/chuckerteam/chucker/api/ChuckerInterceptor.kt#L193
and
https://github.com/ChuckerTeam/chucker/blob/main/library/src/main/kotlin/com/chuckerteam/chucker/api/ChuckerInterceptor.kt#L75

💣 Steps to reproduce

chucker = "4.0.0"

                ChuckerInterceptor.Builder(app)
                    .skipPaths("/f1/proxy/ggw/posthog-proxy/public/capture")
                    .build()

Result:

Bildschirmfoto 2024-06-26 um 12 08 55

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions