Skip to content

Commit

Permalink
fix(android): Send cookies on proxied requests (#2151)
Browse files Browse the repository at this point in the history
  • Loading branch information
macdja38 authored and jcesarmobile committed Nov 12, 2019
1 parent 5e9ce8c commit fbe0b9d
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import android.content.Context;
import android.net.Uri;
import android.util.Log;
import android.webkit.CookieManager;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;

Expand Down Expand Up @@ -297,6 +298,7 @@ private WebResourceResponse handleProxyRequest(WebResourceRequest request, PathH
for (Map.Entry<String, String> header : headers.entrySet()) {
conn.setRequestProperty(header.getKey(), header.getValue());
}
conn.setRequestProperty("Cookie", CookieManager.getInstance().getCookie(request.getUrl().toString()));
conn.setRequestMethod(method);
conn.setReadTimeout(30 * 1000);
conn.setConnectTimeout(30 * 1000);
Expand Down

0 comments on commit fbe0b9d

Please sign in to comment.