Added option to disable HTTP redirecting

This commit is contained in:
M66B
2023-12-10 09:24:24 +01:00
parent b10ea057aa
commit 0c87e0f9cf
4 changed files with 27 additions and 3 deletions

View File

@@ -723,6 +723,7 @@ public class ConnectionHelper {
// https://support.google.com/faqs/answer/7188426
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean open_safe = prefs.getBoolean("open_safe", false);
boolean http_redirect = prefs.getBoolean("http_redirect", true);
int redirects = 0;
while (true) {
@@ -752,7 +753,7 @@ public class ConnectionHelper {
try {
int status = urlConnection.getResponseCode();
if (!open_safe &&
if (http_redirect &&
(status == HttpURLConnection.HTTP_MOVED_PERM ||
status == HttpURLConnection.HTTP_MOVED_TEMP ||
status == HttpURLConnection.HTTP_SEE_OTHER ||