mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Remove port from JSLocation when returning packager host
Summary: Changelog: Some callsites may rely on the assumption that address return by this method does not contain port information. JSLocation saved in NSUserDefault might contain port information, removing it here can prevent the issue for callsites. Differential Revision: D23240495 fbshipit-source-id: a2edf4abb086fd951dd089331407bd659aad1729
This commit is contained in:
committed by
Facebook GitHub Bot
parent
1271462cb2
commit
12543d557f
@@ -125,6 +125,12 @@ static NSURL *serverRootWithHostPort(NSString *hostPort)
|
||||
- (NSString *)packagerServerHost
|
||||
{
|
||||
NSString *location = [self jsLocation];
|
||||
if (location) {
|
||||
NSInteger index = [location rangeOfString:@":"].location;
|
||||
if (index != NSNotFound) {
|
||||
location = [location substringToIndex:index];
|
||||
}
|
||||
}
|
||||
#if RCT_DEV_MENU
|
||||
if ([location length] && ![RCTBundleURLProvider isPackagerRunning:location]) {
|
||||
location = nil;
|
||||
|
||||
Reference in New Issue
Block a user