Commit 6f87a07
Fix iOS inspector getServerHost to handle HTTPS correctly (#55872)
Summary:
Pull Request resolved: #55872
## Summary:
Update `getServerHost()` in `RCTInspectorDevServerHelper` to properly handle
HTTPS connections. When the bundle URL uses HTTPS, the port is omitted from the
host string (the scheme implies 443). The explicit port from the URL takes
priority, followed by the `RCT_METRO_PORT` environment variable, with 8081
as the default fallback for local development.
## Changelog:
[IOS][FIXED] - Fix inspector server host resolution for HTTPS bundle URLs by omitting default port
## Test Plan:
Verified that getServerHost returns:
- `host:port` when an explicit port is in the URL
- `host:envPort` when RCT_METRO_PORT is set
- `host` (no port) when the scheme is https
- `host:8081` as the default fallback
## Facebook:
Applied from nest/mobile/apps/atod-sample/patches/react-native+0.83.1+008+atod-ios-ws-fixes.patch
Reviewed By: cortinico
Differential Revision: D950380041 parent 5ed7dd4 commit 6f87a07
File tree
1 file changed
+19
-14
lines changed- packages/react-native/React/DevSupport
1 file changed
+19
-14
lines changedLines changed: 19 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | 27 | | |
35 | 28 | | |
36 | 29 | | |
37 | 30 | | |
38 | 31 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
| |||
0 commit comments