Package 

Class CDNImageInterceptor

  • All Implemented Interfaces:
    coil3.intercept.Interceptor

    
    public final class CDNImageInterceptor
     implements Interceptor
                        

    A Coil Interceptor that intercepts image requests and applies CDN transformations.

    The interceptor calls CDN.imageRequest to obtain a potentially modified URL and additional headers. CDN headers take precedence over any headers already present on the request (e.g. from io.getstream.chat.android.ui.common.helper.ImageHeadersProvider), overriding them for the same key.

    Only HTTP/HTTPS URLs are intercepted; local resources, content URIs, etc. pass through unchanged.

    The CDN instance is resolved lazily via cdn on each request, so the interceptor is safe to install even before ChatClient is initialized (e.g. Compose previews, VRT tests). When cdn returns null the request passes through unchanged.

    • Constructor Summary

      Constructors 
      Constructor Description
      CDNImageInterceptor(Function0<CDN> cdn)
    • Method Summary

      Modifier and Type Method Description
      ImageResult intercept(Interceptor.Chain chain)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CDNImageInterceptor

        CDNImageInterceptor(Function0<CDN> cdn)
    • Method Detail

      • intercept

         ImageResult intercept(Interceptor.Chain chain)