One-click redirect

This commit is contained in:
M66B
2025-08-20 19:59:39 +02:00
parent b078f381b1
commit 9ec18f0ee8

View File

@@ -98,6 +98,7 @@ public class FragmentDialogUnsubscribe extends FragmentDialogBase {
connection.setDoOutput(true);
connection.setReadTimeout(UNSUBSCRIBE_TIMEOUT);
connection.setConnectTimeout(UNSUBSCRIBE_TIMEOUT);
connection.setInstanceFollowRedirects(true);
ConnectionHelper.setUserAgent(context, connection);
connection.setRequestProperty("Content-Length", Integer.toString(request.length()));
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
@@ -107,7 +108,7 @@ public class FragmentDialogUnsubscribe extends FragmentDialogBase {
connection.getOutputStream().write(request.getBytes());
int status = connection.getResponseCode();
if (status < 200 || status > 299) {
if (status >= 400) {
String error = "Error " + status + ": " + connection.getResponseMessage();
Log.i("Unsubscribe error=" + error);
InputStream stream = connection.getErrorStream();