Skip to content

Commit fd85b84

Browse files
bill2004158facebook-github-bot
authored andcommitted
Update RCTSRWebSocket.m (#29419)
Summary: Only add Sec-WebSocket-Protocol header if has _requestedProtocols. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [iOS] [Fixed] - when Sec-WebSocket-Protocol header is empty vaulue, IIS server will return error 502. Pull Request resolved: #29419 Reviewed By: cpojer Differential Revision: D22782867 Pulled By: PeteTheHeat fbshipit-source-id: d588997a345929b0c11c554d4452e612a336901a
1 parent 1b362f9 commit fd85b84

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Libraries/WebSocket/RCTSRWebSocket.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ - (void)didConnect
462462

463463
CFHTTPMessageSetHeaderFieldValue(request, CFSTR("Origin"), (__bridge CFStringRef)_url.RCTSR_origin);
464464

465-
if (_requestedProtocols) {
465+
if (_requestedProtocols && _requestedProtocols.count > 0) {
466466
CFHTTPMessageSetHeaderFieldValue(request, CFSTR("Sec-WebSocket-Protocol"), (__bridge CFStringRef)[_requestedProtocols componentsJoinedByString:@", "]);
467467
}
468468

0 commit comments

Comments
 (0)