[PR #6630] 🍒[PM-33262] feat: Add cookie support to Glide image requests #12877

Closed
opened 2026-04-11 03:52:44 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/bitwarden/android/pull/6630

State: closed
Merged: Yes


🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-33262
Cherry-picked from #6627

📔 Objective

Enterprise environments using SSO cookie vendors (e.g., Cloudflare Access) require cookies on image requests for icons to load through cookie-gated proxies. Without cookies, Glide requests fail silently and icons don't display.

This adds a lenient GlideCookieInterceptor to Glide's OkHttpClient that:

  • Attaches cookies from NetworkCookieManager to image requests by hostname
  • Never throws exceptions or triggers cookie bootstrap (unlike the API CookieInterceptor)
  • Degrades gracefully if no cookies are available — images simply won't load rather than crashing

Changes

  • GlideCookieInterceptor (new): Lenient OkHttp interceptor that reads cookies via CookieProvider and attaches them to Glide requests
  • BitwardenAppGlideModule: Wires NetworkCookieManager into the Glide OkHttpClient via Hilt entry point
  • Tests: 5 interceptor tests + 1 entry point test covering cookie attachment, empty cookies, 302 handling, and no-bootstrap verification
**Original Pull Request:** https://github.com/bitwarden/android/pull/6630 **State:** closed **Merged:** Yes --- ## 🎟️ Tracking https://bitwarden.atlassian.net/browse/PM-33262 Cherry-picked from #6627 ## 📔 Objective Enterprise environments using SSO cookie vendors (e.g., Cloudflare Access) require cookies on image requests for icons to load through cookie-gated proxies. Without cookies, Glide requests fail silently and icons don't display. This adds a lenient `GlideCookieInterceptor` to Glide's OkHttpClient that: - Attaches cookies from `NetworkCookieManager` to image requests by hostname - Never throws exceptions or triggers cookie bootstrap (unlike the API `CookieInterceptor`) - Degrades gracefully if no cookies are available — images simply won't load rather than crashing ### Changes - **`GlideCookieInterceptor`** (new): Lenient OkHttp interceptor that reads cookies via `CookieProvider` and attaches them to Glide requests - **`BitwardenAppGlideModule`**: Wires `NetworkCookieManager` into the Glide OkHttpClient via Hilt entry point - **Tests**: 5 interceptor tests + 1 entry point test covering cookie attachment, empty cookies, 302 handling, and no-bootstrap verification
GiteaMirror added the pull-request label 2026-04-11 03:52:44 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#12877