Skip to content

Commit

Permalink
Update RCTSRWebSocket.m
Browse files Browse the repository at this point in the history
Only add Sec-WebSocket-Protocol header if has _requestedProtocols.
  • Loading branch information
bill2004158 authored Jul 18, 2020
1 parent f00795d commit 2529fa6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Libraries/WebSocket/RCTSRWebSocket.m
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ - (void)didConnect

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

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

Expand Down

0 comments on commit 2529fa6

Please sign in to comment.