Allow http for LanguageTool

pull/212/head
M66B 2 years ago
parent 6a14b91f55
commit 7df075aaab

@ -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…
Cancel
Save