Minor updates and fixes
Этот коммит содержится в:
@@ -109,7 +109,8 @@ public class MainFragment extends WebViewFragment {
|
||||
@Override
|
||||
public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
|
||||
Uri uri = Uri.parse(url);
|
||||
if (uri.getHost().equals("cdnjs.cloudflare.com")) {
|
||||
String host = uri.getHost();
|
||||
if (host != null && host.equals("cdnjs.cloudflare.com")) {
|
||||
String path = uri.getPath().substring("/ajax/libs".length());
|
||||
try {
|
||||
return loadFileFromAssets(url, "cdnjs" + path);
|
||||
|
||||
@@ -64,7 +64,7 @@ public class StartFragment extends Fragment implements View.OnClickListener {
|
||||
protected Boolean doInBackground(String... urls) {
|
||||
try {
|
||||
|
||||
Uri uri = Uri.parse(urls[0]).buildUpon().appendPath("api/server").build();
|
||||
Uri uri = Uri.parse(urls[0]).buildUpon().appendEncodedPath("api/server").build();
|
||||
URL url = new URL(uri.toString());
|
||||
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
|
||||
|
||||
Ссылка в новой задаче
Block a user