File tree Expand file tree Collapse file tree
packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/websocket Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -495,7 +495,9 @@ public class WebSocketModule(context: ReactApplicationContext) :
495495
496496 /* *
497497 * Get the URI used to look up cookies for a specific WebSocket URI, keeping its path so that
498- * path-scoped cookies are matched correctly
498+ * path-scoped cookies are matched correctly. Query and fragment are dropped since cookies are
499+ * scoped by path, not by query or fragment (RFC 6265). userInfo is also dropped so that
500+ * credentials embedded in the URL are never forwarded to the cookie store.
499501 *
500502 * @param uri
501503 * @return A URI with the endpoint converted to HTTP protocol (http[s]://host[:port]/path)
@@ -509,8 +511,8 @@ public class WebSocketModule(context: ReactApplicationContext) :
509511 requestURI.host,
510512 requestURI.port,
511513 requestURI.path,
512- requestURI.query ,
513- requestURI.fragment ,
514+ null ,
515+ null ,
514516 )
515517 } catch (e: URISyntaxException ) {
516518 throw IllegalArgumentException (" Unable to get cookie lookup URI from $uri " )
You can’t perform that action at this time.
0 commit comments