Skip to content

Commit 7c031ca

Browse files
bottledwalterMartin Konicek
authored andcommitted
RN: Packager URL defaults to port 8081 if no port in bundleURL
Summary:The packager url for the persistent connection relied on a port in the bundleURL, so we need to insert a sensible default. Otherwise, issues occur: #6581 Reviewed By: bestander Differential Revision: D3113034 fb-gh-sync-id: 4eac52631ad7abd343b75a4488bb591b5caf2145 fbshipit-source-id: 4eac52631ad7abd343b75a4488bb591b5caf2145
1 parent 3983282 commit 7c031ca

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

React/Modules/RCTDevMenu.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,9 @@ - (NSURL *)packagerURL
239239

240240
NSString *scheme = [_bridge.bundleURL scheme];
241241
NSNumber *port = [_bridge.bundleURL port];
242+
if (!port) {
243+
port = @8081; // Packager default port
244+
}
242245
return [NSURL URLWithString:[NSString stringWithFormat:@"%@://%@:%@/message?role=shell", scheme, host, port]];
243246
}
244247

0 commit comments

Comments
 (0)