]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/backgroundtasks/GetSourceBackgroundTask.java
Release 3.12.
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / backgroundtasks / GetSourceBackgroundTask.java
index d9da8bcc407623e50c8b3e11ff9a3fc3cda097cc..26f57a12511a1d0f965513813905dc985d802ddd 100644 (file)
@@ -24,7 +24,6 @@ import android.content.ContentResolver;
 import android.database.Cursor;
 import android.graphics.Typeface;
 import android.net.Uri;
-import android.os.Build;
 import android.text.SpannableStringBuilder;
 import android.text.Spanned;
 import android.text.style.StyleSpan;
@@ -147,15 +146,6 @@ public class GetSourceBackgroundTask {
                 requestHeadersBuilder.append(userAgent);
 
 
-                // Set the `x-requested-with` header property.
-                httpUrlConnection.setRequestProperty("x-requested-with", "");
-
-                // Add the `x-requested-with` header to the string builder and format the text.
-                requestHeadersBuilder.append(System.getProperty("line.separator"));
-                requestHeadersBuilder.append("x-requested-with", new StyleSpan(Typeface.BOLD), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
-                requestHeadersBuilder.append(":  ");
-
-
                 // Set the `Sec-Fetch-Site` header property.
                 httpUrlConnection.setRequestProperty("Sec-Fetch-Site", "none");
 
@@ -233,8 +223,9 @@ public class GetSourceBackgroundTask {
                         return true;
                     };
 
-                    // Create a new trust manager.
-                    TrustManager[] trustManager = new TrustManager[] {
+                    // Create a new trust manager.  Lint wants to warn us that it is hard to securely implement an X509 trust manager.
+                    // But the point of this trust manager is that it should accept all certificates no matter what, so that isn't an issue in our case.
+                    @SuppressLint("CustomX509TrustManager") TrustManager[] trustManager = new TrustManager[] {
                             new X509TrustManager() {
                                 @SuppressLint("TrustAllX509TrustManager")
                                 @Override