@@ -37,6 +37,7 @@ public class Http {
3737 OkHttpClient .Builder httpclientBuilder = new OkHttpClient .Builder ();
3838 httpclientBuilder .connectTimeout (11 , TimeUnit .SECONDS );
3939 try {
40+ httpclientBuilder .cookieJar (new CDNCookieJar ());
4041 httpclientBuilder .dns (new DnsOverHttps .Builder ().client (httpclientBuilder .build ()).url (
4142 Objects .requireNonNull (HttpUrl .parse ("https://cloudflare-dns.com/dns-query" )))
4243 .bootstrapDnsHosts (
@@ -53,6 +54,7 @@ public class Http {
5354 } catch (UnknownHostException |RuntimeException e ) {
5455 Log .e ("Http" , "Failed to init DoH" , e );
5556 }
57+ httpclientBuilder .cookieJar (CookieJar .NO_COOKIES );
5658 httpClient = httpclientBuilder .build ();
5759 MainApplication mainApplication = MainApplication .getINSTANCE ();
5860 if (mainApplication != null ) {
@@ -139,7 +141,10 @@ public static byte[] doHttpGet(String url,ProgressListener progressListener) thr
139141 * Cookie jar that allow CDN cookies, reset on app relaunch
140142 * Note: An argument can be made that it allow tracking but
141143 * caching is a better attack vector for tracking, this system
142- * only exist to help CDN and cache to work together.
144+ * only exist to improve CDN response time, any other cookies
145+ * that are not CDN related are just simply ignored.
146+ *
147+ * Note: CDNCookies are only stored in RAM unlike https cache
143148 * */
144149 private static class CDNCookieJar implements CookieJar {
145150 private final HashMap <String , Cookie > cookieMap = new HashMap <>();
0 commit comments