File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
src/SignalR/server/Core/src Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 2
2
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3
3
4
4
using System . Collections . Generic ;
5
+ using Microsoft . AspNetCore . SignalR . Protocol ;
5
6
using Microsoft . Extensions . Options ;
6
7
7
8
namespace Microsoft . AspNetCore . SignalR
@@ -16,6 +17,7 @@ public HubOptionsSetup(IOptions<HubOptions> options)
16
17
17
18
public void Configure ( HubOptions < THub > options )
18
19
{
20
+ // Do a deep copy, otherwise users modifying the HubOptions<THub> list would be changing the global options list
19
21
options . SupportedProtocols = new List < string > ( _hubOptions . SupportedProtocols . Count ) ;
20
22
foreach ( var protocol in _hubOptions . SupportedProtocols )
21
23
{
@@ -24,7 +26,12 @@ public void Configure(HubOptions<THub> options)
24
26
options . KeepAliveInterval = _hubOptions . KeepAliveInterval ;
25
27
options . HandshakeTimeout = _hubOptions . HandshakeTimeout ;
26
28
27
- options . AdditionalHubProtocols = _hubOptions . AdditionalHubProtocols ;
29
+ // Do a deep copy, otherwise users modifying the HubOptions<THub> list would be changing the global options list
30
+ options . AdditionalHubProtocols = new List < IHubProtocol > ( _hubOptions . AdditionalHubProtocols . Count ) ;
31
+ foreach ( var protocol in _hubOptions . AdditionalHubProtocols )
32
+ {
33
+ options . AdditionalHubProtocols . Add ( protocol ) ;
34
+ }
28
35
}
29
36
}
30
37
}
You can’t perform that action at this time.
0 commit comments