-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Http user agent changed after 3.6.1 release #546
Comments
Hmm, maybe both... There has been some changes to user agent handling, see 3.6.1 release notes and v3.6.0...v3.6.1. |
Hello Róbert, I use just Glide, the new feature from 3.6.0 release. My usage: Glide.with(context)
.load(HttpHeader.getUrl(source))
.into(ViewHolder.Image); HttpHeader class: public class HttpHeader {
public static final String USER_AGENT = "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0";
public static final String APP_AGENT = "XYZ";
public static GlideUrl getUrl(String url) {
if (TextUtils.isEmpty(url)) {
return null;
}
else return new GlideUrl(url, new LazyHeaders.Builder()
.addHeader("User-Agent", USER_AGENT)
.addHeader("App-agent", APP_AGENT)
.build());
}
} |
@sjudd confirmed, it's a bug, it looks like the LazyHeaders headers = new Builder()
.addHeader("User-Agent", "My user agent")
.addHeader("App-agent", "My app agent")
.build();
System.out.println(headers);
System.out.println(headers.getHeaders()); 3.6.0:
3.6.1:
@TomasValenta workaround is really simple if you want to use Glide 3.6.1 ( LazyHeaders headers = new Builder()
.setHeader("User-Agent", "My user agent")
.addHeader("App-agent", "My app agent")
.build(); |
Thank you Róbert! |
Urk, thanks for reporting this, I'll take look! |
@sjudd This looks like it's been fixed on your 3.0 branch and has been also merged to bumptech/glide 3.0 branch, but not yet released (scheduled for 3.6.2 or 3.7.0). I thought merging a "fixes #???" commit will close the issue, but it seems that only works on master or the default branch. Closing this manually because I see the commit on the right branch. |
Fixes bumptech#546. Conflicts: library/src/androidTest/java/com/bumptech/glide/load/model/LazyHeadersTest.java library/src/main/java/com/bumptech/glide/load/model/LazyHeaders.java library/src/test/resources/exif-orientation-examples
Confirmed fixed. Thank you! |
Hello,
in 3.6.0 release the cusotm Http user agent look like this:
after 3.6.1 release the same cusotm Http user agent look like this:
It's a bug or feature? Because in my app this change brought new problems ;)
The text was updated successfully, but these errors were encountered: