You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when specifying a particular user agent value in my http header via an OKHttp3 interceptor, e.g. with MY_CUSTOM_USER_AGENT_RIGHT_HERE, the user agent field seems to get mixed with the default http.agent system property defined in LazyHeaders.java:
So the result looks as follows and thereby the request to my backend (infrastructure) starts failing (as my backend only expects and accepts the defined value):
Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075); MY_CUSTOM_USER_AGENT_RIGHT_HERE
Imho it seems that both user agent values are getting mixed in the end by the OkHttpStreamFetcher.java in loadData() when the built up request + client are coming together. Quite similar to a problem ~ 3 years ago: #546
Issue details / Repro steps / Use case background:
Integration libraries:
Glide-OkHttp3-integration, 4.9 as well
Other libraries:
OkHttp3, 3.12.1
Device/Android Version:
Can be tested on an AVD Pie x86 image but also reproducible on Samsung S6, S7, Google Pixel or Huawei devices. Imho not device specific related
Question:
Is it required to set the user agent somewhere else instead of using an interceptor? -> From your point of view works as designed? If yes, what would be the right way?
Or Is this actually a bug that such conflicts should not occur?
The text was updated successfully, but these errors were encountered:
Your requests have 2 User-Agent headers since Glide adds one and you add one too.
You have to use header(key, value) instead of addHeader(key, value) to replace the existing header.
Hi folks,
when specifying a particular user agent value in my http header via an OKHttp3 interceptor, e.g. with
MY_CUSTOM_USER_AGENT_RIGHT_HERE
, the user agent field seems to get mixed with the defaulthttp.agent
system property defined inLazyHeaders.java
:String defaultUserAgent = System.getProperty("http.agent");
So the result looks as follows and thereby the request to my backend (infrastructure) starts failing (as my backend only expects and accepts the defined value):
Imho it seems that both user agent values are getting mixed in the end by the
OkHttpStreamFetcher.java
inloadData()
when the built up request + client are coming together. Quite similar to a problem ~ 3 years ago: #546Issue details / Repro steps / Use case background:
My Interceptor:
My used Glide Module:
Glide load line:
I'm using data binding to set the loading mechanism for ImageViews
Glide Version:
Glide 4.9, latest release
Integration libraries:
Glide-OkHttp3-integration, 4.9 as well
Other libraries:
OkHttp3, 3.12.1
Device/Android Version:
Can be tested on an AVD Pie x86 image but also reproducible on Samsung S6, S7, Google Pixel or Huawei devices. Imho not device specific related
Question:
The text was updated successfully, but these errors were encountered: