Skip to content

Commit 7997d57

Browse files
authored
Reuse NegotiateMetadata (#36184)
1 parent 03cae4e commit 7997d57

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/SignalR/common/Http.Connections/src/ConnectionEndpointRouteBuilderExtensions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ namespace Microsoft.AspNetCore.Builder
1616
/// </summary>
1717
public static class ConnectionEndpointRouteBuilderExtensions
1818
{
19+
private static readonly NegotiateMetadata _negotiateMetadata = new NegotiateMetadata();
20+
1921
/// <summary>
2022
/// Maps incoming requests with the specified path to the provided connection pipeline.
2123
/// </summary>
@@ -101,7 +103,7 @@ public static ConnectionEndpointRouteBuilder MapConnections(this IEndpointRouteB
101103
var negotiateBuilder = endpoints.Map(pattern + "/negotiate", negotiateHandler);
102104
conventionBuilders.Add(negotiateBuilder);
103105
// Add the negotiate metadata so this endpoint can be identified
104-
negotiateBuilder.WithMetadata(new NegotiateMetadata());
106+
negotiateBuilder.WithMetadata(_negotiateMetadata);
105107
negotiateBuilder.WithMetadata(options);
106108

107109
// build the execute handler part of the protocol

0 commit comments

Comments
 (0)