Revert "Update basic middleware projects to netcoreapp3.0"
This partially reverts commit e0bbda07fc.
This commit is contained in:
parent
3e571eb519
commit
7fad55f6b6
|
|
@ -4,7 +4,7 @@
|
||||||
<Description>
|
<Description>
|
||||||
ASP.NET Core middleware for filtering out requests with unknown HTTP host headers.
|
ASP.NET Core middleware for filtering out requests with unknown HTTP host headers.
|
||||||
</Description>
|
</Description>
|
||||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
<PackageTags>aspnetcore</PackageTags>
|
<PackageTags>aspnetcore</PackageTags>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
<Description>
|
<Description>
|
||||||
ASP.NET Core basic middleware for supporting HTTPS Redirection and HTTP Strict-Transport-Security.
|
ASP.NET Core basic middleware for supporting HTTPS Redirection and HTTP Strict-Transport-Security.
|
||||||
</Description>
|
</Description>
|
||||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
<PackageTags>aspnetcore;https;hsts</PackageTags>
|
<PackageTags>aspnetcore;https;hsts</PackageTags>
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,15 @@ namespace Microsoft.AspNetCore.ResponseCompression
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public Stream CreateStream(Stream outputStream)
|
public Stream CreateStream(Stream outputStream)
|
||||||
=> new BrotliStream(outputStream, Options.Level, leaveOpen: true);
|
{
|
||||||
|
#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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,19 @@ namespace Microsoft.AspNetCore.ResponseCompression
|
||||||
public string EncodingName { get; } = "gzip";
|
public string EncodingName { get; } = "gzip";
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public bool SupportsFlush { get; } = true;
|
public bool SupportsFlush
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
#if NET461
|
||||||
|
return false;
|
||||||
|
#elif NETSTANDARD2_0 || NETCOREAPP2_1
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
|
#error target frameworks need to be updated
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public Stream CreateStream(Stream outputStream)
|
public Stream CreateStream(Stream outputStream)
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Description>ASP.NET Core middleware for HTTP Response compression.</Description>
|
<Description>ASP.NET Core middleware for HTTP Response compression.</Description>
|
||||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
<TargetFrameworks>net461;netstandard2.0;netcoreapp2.1</TargetFrameworks>
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
<PackageTags>aspnetcore</PackageTags>
|
<PackageTags>aspnetcore</PackageTags>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,13 @@ namespace Microsoft.AspNetCore.ResponseCompression
|
||||||
// Use the factory so it can resolve IOptions<GzipCompressionProviderOptions> from DI.
|
// Use the factory so it can resolve IOptions<GzipCompressionProviderOptions> from DI.
|
||||||
_providers = new ICompressionProvider[]
|
_providers = new ICompressionProvider[]
|
||||||
{
|
{
|
||||||
|
#if NETCOREAPP2_1
|
||||||
new CompressionProviderFactory(typeof(BrotliCompressionProvider)),
|
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)),
|
new CompressionProviderFactory(typeof(GzipCompressionProvider)),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
* Support for custom URL rewrite rules
|
* Support for custom URL rewrite rules
|
||||||
* Support for running IIS URL Rewrite module rules
|
* Support for running IIS URL Rewrite module rules
|
||||||
* Support for running Apache mod_rewrite rules.</Description>
|
* Support for running Apache mod_rewrite rules.</Description>
|
||||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
<PackageTags>aspnetcore;urlrewrite;mod_rewrite</PackageTags>
|
<PackageTags>aspnetcore;urlrewrite;mod_rewrite</PackageTags>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue