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

Closed
opened 2026-04-18 16:06:36 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/6630
Author: @SaintPatrck
Created: 3/9/2026
Status: Merged
Merged: 3/10/2026
Merged by: @SaintPatrck

Base: release/2026.3-rc48Head: release/2026.3-rc48_cp-PM-33262


📝 Commits (1)

  • f87f4cf [PM-33262] feat: Add cookie support to Glide image requests (#6627)

📊 Changes

4 files changed (+243 additions, -2 deletions)

View changed files

📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/glide/BitwardenAppGlideModule.kt (+18 -2)
app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/glide/GlideCookieInterceptor.kt (+49 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/glide/BitwardenAppGlideModuleTest.kt (+13 -0)
app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/glide/GlideCookieInterceptorTest.kt (+163 -0)

📄 Description

🎟️ 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

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/6630 **Author:** [@SaintPatrck](https://github.com/SaintPatrck) **Created:** 3/9/2026 **Status:** ✅ Merged **Merged:** 3/10/2026 **Merged by:** [@SaintPatrck](https://github.com/SaintPatrck) **Base:** `release/2026.3-rc48` ← **Head:** `release/2026.3-rc48_cp-PM-33262` --- ### 📝 Commits (1) - [`f87f4cf`](https://github.com/bitwarden/android/commit/f87f4cfb9bed3e57eb47cdf4b485a80f4e71b56e) [PM-33262] feat: Add cookie support to Glide image requests (#6627) ### 📊 Changes **4 files changed** (+243 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/glide/BitwardenAppGlideModule.kt` (+18 -2) ➕ `app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/glide/GlideCookieInterceptor.kt` (+49 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/glide/BitwardenAppGlideModuleTest.kt` (+13 -0) ➕ `app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/glide/GlideCookieInterceptorTest.kt` (+163 -0) </details> ### 📄 Description ## 🎟️ 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-18 16:06:36 -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#32743