Skip to content

StrictModeViolation: GzipSource is not closed #472

@mattprecious

Description

@mattprecious

✍️ Describe the bug

Caused by: java.lang.Throwable: Explicit termination method 'end' not called
   at dalvik.system.CloseGuard.open(CloseGuard.java:237)
   at java.util.zip.Inflater.<init>(Inflater.java:122)
   at okio.GzipSource.<init>(GzipSource.kt:44)
   at com.chuckerteam.chucker.internal.support.IOUtils.getNativeSource(IOUtils.kt:59)
   at com.chuckerteam.chucker.api.ChuckerInterceptor.processRequest(ChuckerInterceptor.kt:132)
   at com.chuckerteam.chucker.api.ChuckerInterceptor.intercept(ChuckerInterceptor.kt:97)

💣 Steps to reproduce

StrictMode.setVmPolicy(
  VmPolicy.Builder()
    .detectLeakedClosableObjects()
    .penaltyLog()
    .penaltyDeath()
)

Call an endpoint using gzip compression.

🔧 Expected behavior

No violation. GzipSource is closed.

📱 Tech info

  • Chucker version: 3.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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