Skip to content

Commit 7eacd8a

Browse files
committed
Add pragmas
1 parent d1bde1d commit 7eacd8a

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

src/Servers/Kestrel/Core/src/Internal/HttpConnection.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,10 @@ public async Task ProcessRequestsAsync<TContext>(IHttpApplication<TContext> http
7070
requestProcessor = new Http2Connection((HttpConnectionContext)_context);
7171
_protocolSelectionState = ProtocolSelectionState.Selected;
7272
break;
73+
#pragma warning disable CA2252 // Preview Features
7374
case HttpProtocols.Http3:
7475
requestProcessor = new Http3Connection((HttpMultiplexedConnectionContext)_context);
76+
#pragma warning restore CA2252
7577
_protocolSelectionState = ProtocolSelectionState.Selected;
7678
break;
7779
case HttpProtocols.None:
@@ -205,7 +207,9 @@ private HttpProtocols SelectProtocol()
205207
var isMultiplexTransport = _context is HttpMultiplexedConnectionContext;
206208
var http1Enabled = _context.Protocols.HasFlag(HttpProtocols.Http1);
207209
var http2Enabled = _context.Protocols.HasFlag(HttpProtocols.Http2);
210+
#pragma warning disable CA2252 // Preview Features
208211
var http3Enabled = _context.Protocols.HasFlag(HttpProtocols.Http3);
212+
#pragma warning restore CA2252
209213

210214
string? error = null;
211215

src/Servers/Kestrel/Core/src/Internal/KestrelServerImpl.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ async Task OnBind(ListenOptions options, CancellationToken onBindCancellationTok
168168
{
169169
var hasHttp1 = options.Protocols.HasFlag(HttpProtocols.Http1);
170170
var hasHttp2 = options.Protocols.HasFlag(HttpProtocols.Http2);
171+
#pragma warning disable CA2252 // Preview Features
171172
var hasHttp3 = options.Protocols.HasFlag(HttpProtocols.Http3);
173+
#pragma warning restore CA2252
172174
var hasTls = options.IsTls;
173175

174176
// Filter out invalid combinations.

src/Servers/Kestrel/Core/src/ListenOptionsHttpsExtensions.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,12 @@ public static ListenOptions UseHttps(this ListenOptions listenOptions, ServerOpt
256256
/// <returns>The <see cref="ListenOptions"/>.</returns>
257257
public static ListenOptions UseHttps(this ListenOptions listenOptions, ServerOptionsSelectionCallback serverOptionsSelectionCallback, object state, TimeSpan handshakeTimeout)
258258
{
259+
#pragma warning disable CA2252 // Preview Features
259260
if (listenOptions.Protocols.HasFlag(HttpProtocols.Http3))
260261
{
261262
throw new NotSupportedException($"{nameof(UseHttps)} with {nameof(ServerOptionsSelectionCallback)} is not supported with HTTP/3.");
262263
}
264+
#pragma warning restore CA2252
263265
return listenOptions.UseHttps(new TlsHandshakeCallbackOptions()
264266
{
265267
OnConnection = context => serverOptionsSelectionCallback(context.SslStream, context.ClientHelloInfo, context.State, context.CancellationToken),
@@ -287,10 +289,12 @@ public static ListenOptions UseHttps(this ListenOptions listenOptions, TlsHandsh
287289
throw new ArgumentException($"{nameof(TlsHandshakeCallbackOptions.OnConnection)} must not be null.");
288290
}
289291

292+
#pragma warning disable CA2252 // Preview Features
290293
if (listenOptions.Protocols.HasFlag(HttpProtocols.Http3))
291294
{
292295
throw new NotSupportedException($"{nameof(UseHttps)} with {nameof(TlsHandshakeCallbackOptions)} is not supported with HTTP/3.");
293296
}
297+
#pragma warning restore CA2252
294298

295299
var loggerFactory = listenOptions.KestrelServerOptions?.ApplicationServices.GetRequiredService<ILoggerFactory>() ?? NullLoggerFactory.Instance;
296300

src/Servers/Kestrel/Transport.Quic/src/Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
<GenerateDocumentationFile>true</GenerateDocumentationFile>
88
<PackageTags>aspnetcore;kestrel</PackageTags>
99
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
10-
<NoWarn>CA1416;CS1591;CS0436;$(NoWarn)</NoWarn><!-- Conflicts between internal and public Quic APIs; Platform support warnings. -->
10+
<NoWarn>CA1416;CS1591;CS0436;$(NoWarn)</NoWarn> <!-- Conflicts between internal and public Quic APIs; Platform support warnings. -->
1111
<IsPackable>false</IsPackable>
1212
<Nullable>enable</Nullable>
13+
<EnablePreviewFeatures>True</EnablePreviewFeatures> <!-- System.Net.Quic is still in preview -->
1314
</PropertyGroup>
1415

1516
<ItemGroup>

0 commit comments

Comments
 (0)