mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-24 15:11:03 +00:00
Allow http for LanguageTool
This commit is contained in:
parent
6a14b91f55
commit
7df075aaab
1 changed files with 3 additions and 2 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue