Skip to content

Change middleware projects to target netcoreapp3.0 #4472

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description>
ASP.NET Core middleware for filtering out requests with unknown HTTP host headers.
</Description>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore</PackageTags>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description>ASP.NET Core basic middleware for supporting HTTP method overrides. Includes:
* X-Forwarded-* headers to forward headers from a proxy.
* HTTP method override header.</Description>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore;proxy;headers;xforwarded</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description>
ASP.NET Core basic middleware for supporting HTTPS Redirection and HTTP Strict-Transport-Security.
</Description>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore;https;hsts</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
Expand Down Expand Up @@ -38,14 +38,7 @@ public BrotliCompressionProvider(IOptions<BrotliCompressionProviderOptions> opti
/// <inheritdoc />
public Stream CreateStream(Stream outputStream)
{
#if NETCOREAPP2_1
return new BrotliStream(outputStream, Options.Level, leaveOpen: true);
#elif NET461 || NETSTANDARD2_0
// Brotli is only supported in .NET Core 2.1+
throw new PlatformNotSupportedException();
#else
#error Target frameworks need to be updated.
#endif
}
}
}
16 changes: 2 additions & 14 deletions src/Middleware/ResponseCompression/src/GzipCompressionProvider.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
Expand Down Expand Up @@ -33,19 +33,7 @@ public GzipCompressionProvider(IOptions<GzipCompressionProviderOptions> options)
public string EncodingName { get; } = "gzip";

/// <inheritdoc />
public bool SupportsFlush
{
get
{
#if NET461
return false;
#elif NETSTANDARD2_0 || NETCOREAPP2_1
return true;
#else
#error target frameworks need to be updated
#endif
}
}
public bool SupportsFlush => true;

/// <inheritdoc />
public Stream CreateStream(Stream outputStream)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>ASP.NET Core middleware for HTTP Response compression.</Description>
<TargetFrameworks>net461;netstandard2.0;netcoreapp2.1</TargetFrameworks>
<TargetFramework>netcoreapp3.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore</PackageTags>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
Expand Down Expand Up @@ -48,13 +48,7 @@ public ResponseCompressionProvider(IServiceProvider services, IOptions<ResponseC
// Use the factory so it can resolve IOptions<GzipCompressionProviderOptions> from DI.
_providers = new ICompressionProvider[]
{
#if NETCOREAPP2_1
new CompressionProviderFactory(typeof(BrotliCompressionProvider)),
#elif NET461 || NETSTANDARD2_0
// Brotli is only supported in .NET Core 2.1+
#else
#error Target frameworks need to be updated.
#endif
new CompressionProviderFactory(typeof(GzipCompressionProvider)),
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Support for custom URL rewrite rules
* Support for running IIS URL Rewrite module rules
* Support for running Apache mod_rewrite rules.</Description>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore;urlrewrite;mod_rewrite</PackageTags>
Expand Down