Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method skipPaths on builder does not work as expected #1237

Open
mikegr opened this issue Jun 26, 2024 · 1 comment
Open

Method skipPaths on builder does not work as expected #1237

mikegr opened this issue Jun 26, 2024 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@mikegr
Copy link

mikegr commented Jun 26, 2024

✍️ 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
@cortinico cortinico added the help wanted Extra attention is needed label Jun 26, 2024
@VenomVendor
Copy link
Contributor

VenomVendor commented Jul 4, 2024

The path is added as single segment instead of segments

Also, the path is encoded which change / to %2F which is wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants