set HTTP User Agent to "F-Droid"
First, this is more honest than just using the default since it is saying what the actual software is. Second, it protects identity, since the default User Agent on Android can have a lot of info in it, for example: "Dalvik/2.1.0 (Linux; U; Android 5.1; XT1039 Build/LPBS23.13-17.3-1)"
This commit is contained in:
parent
ab1e869ebe
commit
6545a26e31
@ -3,6 +3,7 @@ package org.fdroid.fdroid.net;
|
||||
import com.nostra13.universalimageloader.core.download.BaseImageDownloader;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.fdroid.fdroid.BuildConfig;
|
||||
import org.fdroid.fdroid.FDroidApp;
|
||||
import org.fdroid.fdroid.Utils;
|
||||
import org.spongycastle.util.encoders.Base64;
|
||||
@ -116,6 +117,8 @@ public class HttpDownloader extends Downloader {
|
||||
connection = NetCipher.getHttpURLConnection(sourceUrl);
|
||||
}
|
||||
|
||||
connection.setRequestProperty("User-Agent", "F-Droid " + BuildConfig.VERSION_NAME);
|
||||
|
||||
if (username != null && password != null) {
|
||||
// add authorization header from username / password if set
|
||||
String authString = username + ":" + password;
|
||||
|
Loading…
x
Reference in New Issue
Block a user