mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-27 11:25:13 +01:00
Allow http for LanguageTool
This commit is contained in:
@@ -42,6 +42,7 @@ import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -81,7 +82,7 @@ public class LanguageTool {
|
||||
Log.i("LT uri=" + uri);
|
||||
|
||||
URL url = new URL(uri.toString());
|
||||
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
|
||||
HttpURLConnection connection = (HttpsURLConnection) url.openConnection();
|
||||
connection.setRequestMethod("GET");
|
||||
connection.setDoOutput(false);
|
||||
connection.setReadTimeout(LT_TIMEOUT * 1000);
|
||||
@@ -433,7 +434,7 @@ public class LanguageTool {
|
||||
return (!TextUtils.isEmpty(lt_user) && !TextUtils.isEmpty(lt_key));
|
||||
}
|
||||
|
||||
private static void checkStatus(HttpsURLConnection connection) throws IOException {
|
||||
private static void checkStatus(HttpURLConnection connection) throws IOException {
|
||||
int status = connection.getResponseCode();
|
||||
if (status != HttpsURLConnection.HTTP_OK) {
|
||||
String error = "Error " + status + ": " + connection.getResponseMessage();
|
||||
|
||||
Reference in New Issue
Block a user