[PR #6627] [MERGED] [PM-33262] feat: Add cookie support to Glide image requests #37231

Closed
opened 2026-04-21 04:17:53 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

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

Base: mainHead: PM-33262/send-cookies-to-icon-server


📝 Commits (4)

  • 94fdf87 [PM-33262] feat: Add cookie support to Glide image requests
  • dc92d80 Exclude BitwardenAppGlideModule from code coverage
  • 923b8de [PM-32123] fix: Throw CookieRedirectException on 302 in GlideCookieInterceptor
  • 190b04e Update Glide OkHttpClient configuration to use network interceptor for cookies

📊 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

📔 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/6627 **Author:** [@SaintPatrck](https://github.com/SaintPatrck) **Created:** 3/9/2026 **Status:** ✅ Merged **Merged:** 3/9/2026 **Merged by:** [@SaintPatrck](https://github.com/SaintPatrck) **Base:** `main` ← **Head:** `PM-33262/send-cookies-to-icon-server` --- ### 📝 Commits (4) - [`94fdf87`](https://github.com/bitwarden/android/commit/94fdf87e3311108c02913996ef51992254df58a6) [PM-33262] feat: Add cookie support to Glide image requests - [`dc92d80`](https://github.com/bitwarden/android/commit/dc92d806b3f4aa66936add05f4d79b4caa006219) Exclude BitwardenAppGlideModule from code coverage - [`923b8de`](https://github.com/bitwarden/android/commit/923b8de23a839ab2ec90aee809195f8e864d48b6) [PM-32123] fix: Throw CookieRedirectException on 302 in GlideCookieInterceptor - [`190b04e`](https://github.com/bitwarden/android/commit/190b04e3a8199eee4f529322891d6322faa53ec1) Update Glide OkHttpClient configuration to use network interceptor for cookies ### 📊 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 ## 📔 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-21 04:17:53 -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#37231