Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@
SDKROOT = iphoneos;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
XROS_DEPLOYMENT_TARGET = 1.0;
};
name = Debug;
};
Expand Down Expand Up @@ -343,6 +344,7 @@
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
XROS_DEPLOYMENT_TARGET = 1.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ @interface NSURL (RCTSRWebSocket)
// So instead, just map ws -> http and wss -> https.
@property (nonatomic, readonly, copy) NSString *RCTSR_origin;

// NSURL.host drops the brackets of IPv6 literals, which the Host and Origin
// headers require (RFC 3986 section 3.2.2). Use the raw host for socket and TLS names.
@property (nonatomic, readonly, copy) NSString *RCTSR_hostForHeader;

@end


Expand Down Expand Up @@ -449,7 +453,7 @@ - (void)didConnect
CFHTTPMessageRef request = CFHTTPMessageCreateRequest(NULL, CFSTR("GET"), (__bridge CFURLRef)_url, kCFHTTPVersion1_1);

// Set host first so it defaults
CFHTTPMessageSetHeaderFieldValue(request, CFSTR("Host"), (__bridge CFStringRef)(_url.port ? [NSString stringWithFormat:@"%@:%@", _url.host, _url.port] : _url.host));
CFHTTPMessageSetHeaderFieldValue(request, CFSTR("Host"), (__bridge CFStringRef)(_url.port ? [NSString stringWithFormat:@"%@:%@", _url.RCTSR_hostForHeader, _url.port] : _url.RCTSR_hostForHeader));

NSMutableData *keyBytes = [[NSMutableData alloc] initWithLength:16];
int result __unused = SecRandomCopyBytes(kSecRandomDefault, keyBytes.length, keyBytes.mutableBytes);
Expand Down Expand Up @@ -1570,10 +1574,19 @@ - (NSString *)RCTSR_origin
-1);
int port = self.port.intValue;
if (port > 0 && port != defaultPort) {
return [NSString stringWithFormat:@"%@://%@:%d", scheme, self.host, port];
return [NSString stringWithFormat:@"%@://%@:%d", scheme, self.RCTSR_hostForHeader, port];
} else {
return [NSString stringWithFormat:@"%@://%@", scheme, self.host];
return [NSString stringWithFormat:@"%@://%@", scheme, self.RCTSR_hostForHeader];
}
}

- (NSString *)RCTSR_hostForHeader
{
NSString *host = self.host;
if ([host containsString:@":"] && ![host hasPrefix:@"["]) {
return [NSString stringWithFormat:@"[%@]", host];
}
return host;
}

@end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,26 @@
<key>DebugSymbolsPath</key>
<string>dSYMs</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>NativeScriptWebSockets.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>NativeScriptWebSockets.framework/NativeScriptWebSockets</string>
<key>DebugSymbolsPath</key>
<string>dSYMs</string>
<key>LibraryIdentifier</key>
<string>xros-arm64</string>
<string>xros-arm64-simulator</string>
<key>LibraryPath</key>
<string>NativeScriptWebSockets.framework</string>
<key>SupportedArchitectures</key>
Expand All @@ -53,33 +56,32 @@
</array>
<key>SupportedPlatform</key>
<string>xros</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>NativeScriptWebSockets.framework/NativeScriptWebSockets</string>
<key>DebugSymbolsPath</key>
<string>dSYMs</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>NativeScriptWebSockets.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>NativeScriptWebSockets.framework/NativeScriptWebSockets</string>
<key>DebugSymbolsPath</key>
<string>dSYMs</string>
<key>LibraryIdentifier</key>
<string>xros-arm64-simulator</string>
<string>xros-arm64</string>
<key>LibraryPath</key>
<string>NativeScriptWebSockets.framework</string>
<key>SupportedArchitectures</key>
Expand All @@ -88,8 +90,6 @@
</array>
<key>SupportedPlatform</key>
<string>xros</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>24G419</string>
<string>24H241</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
Expand Down
Binary file not shown.
Loading
Loading