question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow to selectively skip Chucker interception

See original GitHub issue

⚠️ Is your feature request related to a problem? Please describe

Sometimes I might not want to involve Chucker in the interception process on some endpoints. For example I know that request or response will be too large so Chucker won’t handle it anyway. Or there might be some bug preventing me from using Chucker on this endpoint but I don’t want to downgrade it as there are some other features I like in the new version.

💡 Describe the solution you’d like

Add a header to the request that would be detected by the ChuckerInterceptor and inform it to not process the request. ChuckerInterceptor would then strip this header and pass it to down the chain without processing it.

It might be something like this.

fun Service {
  @GET("/")
  @Headers(Chucker.SKIP_INTERCEPTOR)
  fun networkRequest(): Unit
}

🙋 Do you want to develop this feature yourself?

  • Yes
  • No

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:3
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
pshcommented, May 28, 2020

But, why not skip the header, and just configure the filters on the interceptor instead?

private val skippedEndpoints: MutableList<(Request) -> Boolean> = mutableListOf()

override fun intercept(chain: Interceptor.Chain): Response {
    val request = chain.request()

    if (skippedEndpoints.any { it(request) }) {
        return chain.proceed(request)
    } else {
        // normal interception logic
    }
}
1reaction
MiSikoracommented, Apr 6, 2020

One consideration might be to create also an extensions like this in the external library.

fun Interceptor.stripping(headerName: String): Interceptor

It would make it easier for Kotlin users to use this feature. Function could be mark with @JvmSynthetic to hide it from Java users. I think that it would be awkward to have such a static utility function.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The time course and characteristics of procedural learning in ...
This approach allowed us to explore open research questions regarding procedural learning, and to identify preserved and impaired information processing ...
Read more >
Wassenaar Arrangement 2017 Plenary Agreements ...
The revision clarified that an item is controlled if (1) the 'cryptography for data confidentially' is usable from the beginning regardless of “ ......
Read more >
TITLE 12. NATURAL RESOURCES - AZ SOS
Application Procedures for Issuance of Hunt Permit-tags by Drawing and Purchase of ... Fully automatic firearms, including firearms capable of selective ...
Read more >
Does small‐perimeter fencing inhibit mule deer or pronghorn ...
... species while allowing desired species access to water (Helvie 1971, ... and feral horses out while allowing wildlife access inside.
Read more >
A Guide to Canada's Export Control List
For information on how to apply for an export permit and additional ... Atom Plasmas (RAP) or ion-beams to selectively remove material.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found