diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/BUCK index 87c26ff73..6289e0598 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/BUCK @@ -7,7 +7,6 @@ android_library( react_native_target('java/com/facebook/react/bridge:bridge'), react_native_target('java/com/facebook/react/common:common'), react_native_target('java/com/facebook/react/modules/core:core'), - react_native_target('java/com/facebook/react/modules/network:network'), react_native_dep('libraries/fbcore/src/main/java/com/facebook/common/logging:logging'), react_native_dep('third-party/java/infer-annotations:infer-annotations'), react_native_dep('third-party/java/jsr-305:jsr-305'), diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.java b/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.java index fc2a422b4..938136f36 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.java @@ -28,7 +28,6 @@ import com.facebook.react.bridge.ReadableType; import com.facebook.react.bridge.WritableMap; import com.facebook.react.common.ReactConstants; import com.facebook.react.modules.core.DeviceEventManagerModule; -import com.facebook.react.modules.network.ForwardingCookieHandler; import com.squareup.okhttp.OkHttpClient; import com.squareup.okhttp.Request; @@ -40,7 +39,6 @@ import com.squareup.okhttp.ws.WebSocketListener; import java.net.URISyntaxException; import java.net.URI; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; @@ -52,12 +50,10 @@ public class WebSocketModule extends ReactContextBaseJavaModule { private Map mWebSocketConnections = new HashMap<>(); private ReactContext mReactContext; - private ForwardingCookieHandler cookieHandler; public WebSocketModule(ReactApplicationContext context) { super(context); mReactContext = context; - cookieHandler = new ForwardingCookieHandler(context); } private void sendEvent(String eventName, WritableMap params) { @@ -84,11 +80,6 @@ public class WebSocketModule extends ReactContextBaseJavaModule { .tag(id) .url(url); - String cookie = getCookie(url); - if (cookie != null) { - builder.addHeader("Cookie", getCookie(url)); - } - if (headers != null) { ReadableMapKeySetIterator iterator = headers.keySetIterator(); @@ -281,25 +272,4 @@ public class WebSocketModule extends ReactContextBaseJavaModule { } } - /** - * Get cookie if exists - * - * @param websocket uri - * @return A cookie / null - */ - - private String getCookie(String uri){ - try { - Map> cookieMap = cookieHandler.get(new URI(setDefaultOrigin(uri)), new HashMap()); - List cookieList = cookieMap.get("Cookie"); - if (cookieList != null) { - return cookieList.get(0); - } else { - return null; - } - } catch(URISyntaxException | IOException e) { - throw new IllegalArgumentException("Unable to get cookie from the " + uri); - } - } - }