X-Git-Url: https://gitweb.stoutner.com/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Fbackgroundtasks%2FGetSourceBackgroundTask.java;h=26f57a12511a1d0f965513813905dc985d802ddd;hb=refs%2Ftags%2Fv3.12;hp=d9da8bcc407623e50c8b3e11ff9a3fc3cda097cc;hpb=8142ac5fc2489de735de4b6fa21a1eae733ccfce;p=PrivacyBrowserAndroid.git diff --git a/app/src/main/java/com/stoutner/privacybrowser/backgroundtasks/GetSourceBackgroundTask.java b/app/src/main/java/com/stoutner/privacybrowser/backgroundtasks/GetSourceBackgroundTask.java index d9da8bcc..26f57a12 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/backgroundtasks/GetSourceBackgroundTask.java +++ b/app/src/main/java/com/stoutner/privacybrowser/backgroundtasks/GetSourceBackgroundTask.java @@ -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