Skip to content

Commit 67f2a67

Browse files
Drop .NET Core 2.1 to fix Azure dependency security issue
1 parent 108a615 commit 67f2a67

File tree

14 files changed

+12
-97
lines changed

14 files changed

+12
-97
lines changed

.github/workflows/build-and-test.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,6 @@ jobs:
2727
framework: net6.0
2828
runtime: -x64
2929
codecov: true
30-
- os: ubuntu-latest
31-
framework: net5.0
32-
runtime: -x64
33-
codecov: false
34-
- os: macos-latest
35-
framework: net5.0
36-
runtime: -x64
37-
codecov: false
38-
- os: windows-latest
39-
framework: net5.0
40-
runtime: -x64
41-
codecov: false
4230
- os: ubuntu-latest
4331
framework: netcoreapp3.1
4432
runtime: -x64
@@ -51,10 +39,6 @@ jobs:
5139
framework: netcoreapp3.1
5240
runtime: -x64
5341
codecov: false
54-
- os: windows-latest
55-
framework: netcoreapp2.1
56-
runtime: -x64
57-
codecov: false
5842

5943
runs-on: ${{matrix.options.os}}
6044

@@ -129,9 +113,7 @@ jobs:
129113
with:
130114
dotnet-version: |
131115
6.0.x
132-
5.0.x
133116
3.1.x
134-
2.1.x
135117
136118
- name: DotNet Build
137119
shell: pwsh

src/ImageSharp.Web.Providers.AWS/ImageSharp.Web.Providers.AWS.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
<Choose>
1717
<When Condition="$(SIXLABORS_TESTING) == true">
1818
<PropertyGroup>
19-
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
19+
<TargetFrameworks>net6.0;netcoreapp3.1</TargetFrameworks>
2020
</PropertyGroup>
2121
</When>
2222
<Otherwise>
2323
<PropertyGroup>
24-
<TargetFrameworks>netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
24+
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
2525
</PropertyGroup>
2626
</Otherwise>
2727
</Choose>

src/ImageSharp.Web.Providers.Azure/ImageSharp.Web.Providers.Azure.csproj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
<Choose>
1717
<When Condition="$(SIXLABORS_TESTING) == true">
1818
<PropertyGroup>
19-
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
19+
<TargetFrameworks>net6.0;netcoreapp3.1</TargetFrameworks>
2020
</PropertyGroup>
2121
</When>
2222
<Otherwise>
2323
<PropertyGroup>
24-
<TargetFrameworks>netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
24+
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
2525
</PropertyGroup>
2626
</Otherwise>
2727
</Choose>
@@ -31,8 +31,7 @@
3131
</ItemGroup>
3232

3333
<ItemGroup>
34-
<!--TODO: Do not upgrade this. Last Version that supports .NET Core 2.1-->
35-
<PackageReference Include="Azure.Storage.Blobs" Version="12.10.0" />
34+
<PackageReference Include="Azure.Storage.Blobs" Version="12.13.0" />
3635
</ItemGroup>
3736

3837
<ItemGroup>

src/ImageSharp.Web/Caching/PhysicalFileSystemCache.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,7 @@ public class PhysicalFileSystemCache : IImageCache
4040
/// <param name="formatUtilities">Contains various format helper methods based on the current configuration.</param>
4141
public PhysicalFileSystemCache(
4242
IOptions<PhysicalFileSystemCacheOptions> options,
43-
#if NETCOREAPP2_1
44-
IHostingEnvironment environment,
45-
#else
4643
IWebHostEnvironment environment,
47-
#endif
4844
FormatUtilities formatUtilities)
4945
{
5046
Guard.NotNull(options, nameof(options));

src/ImageSharp.Web/ImageSharp.Web.csproj

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
<Choose>
1717
<When Condition="$(SIXLABORS_TESTING) == true">
1818
<PropertyGroup>
19-
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
19+
<TargetFrameworks>net6.0;netcoreapp3.1;</TargetFrameworks>
2020
</PropertyGroup>
2121
</When>
2222
<Otherwise>
2323
<PropertyGroup>
24-
<TargetFrameworks>netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
24+
<TargetFrameworks>netcoreapp3.1;</TargetFrameworks>
2525
</PropertyGroup>
2626
</Otherwise>
2727
</Choose>
@@ -30,22 +30,8 @@
3030
<None Include="..\..\shared-infrastructure\branding\icons\imagesharp.web\sixlabors.imagesharp.web.128.png" Pack="true" PackagePath="" />
3131
</ItemGroup>
3232

33-
<ItemGroup Condition="'$(TargetFramework)' != 'netcoreapp2.1'">
34-
<FrameworkReference Include="Microsoft.AspNetCore.App" />
35-
</ItemGroup>
36-
37-
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
38-
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" />
39-
<PackageReference Include="Microsoft.AspNetCore.Http" />
40-
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" />
41-
<PackageReference Include="Microsoft.AspNetCore.Http.Extensions" />
42-
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" />
43-
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" />
44-
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" />
45-
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" />
46-
</ItemGroup>
47-
4833
<ItemGroup>
34+
<FrameworkReference Include="Microsoft.AspNetCore.App" />
4935
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="2.2.0" />
5036
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.3" />
5137
</ItemGroup>

src/ImageSharp.Web/ImageSharpRequestAuthorizationUtilities.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
using System.Globalization;
77
using System.Threading.Tasks;
88
using Microsoft.AspNetCore.Http;
9-
10-
#if !NETCOREAPP3_0_OR_GREATER
11-
using Microsoft.AspNetCore.Http.Internal;
12-
#endif
13-
149
using Microsoft.AspNetCore.WebUtilities;
1510
using Microsoft.Extensions.Options;
1611
using SixLabors.ImageSharp.Web.Commands;

src/ImageSharp.Web/Middleware/ImageSharpMiddleware.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -449,19 +449,7 @@ private ValueTask StreamDisposeAsync(Stream stream)
449449
return default;
450450
}
451451

452-
#if NETCOREAPP2_1
453-
try
454-
{
455-
stream.Dispose();
456-
return default;
457-
}
458-
catch (Exception ex)
459-
{
460-
return new ValueTask(Task.FromException(ex));
461-
}
462-
#else
463452
return stream.DisposeAsync();
464-
#endif
465453
}
466454

467455
private async Task<ImageWorkerResult> IsNewOrUpdatedAsync(

src/ImageSharp.Web/Providers/PhysicalFileSystemProvider.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@ public sealed class PhysicalFileSystemProvider : FileProviderImageProvider
2222
/// <param name="formatUtilities">Contains various format helper methods based on the current configuration.</param>
2323
public PhysicalFileSystemProvider(
2424
IOptions<PhysicalFileSystemProviderOptions> options,
25-
#if NETCOREAPP2_1
26-
IHostingEnvironment environment,
27-
#else
2825
IWebHostEnvironment environment,
29-
#endif
3026
FormatUtilities formatUtilities)
3127
: base(GetProvider(options, environment), options.Value.ProcessingBehavior, formatUtilities)
3228
{
@@ -58,11 +54,7 @@ internal static string GetProviderRoot(PhysicalFileSystemProviderOptions options
5854

5955
private static PhysicalFileProvider GetProvider(
6056
IOptions<PhysicalFileSystemProviderOptions> options,
61-
#if NETCOREAPP2_1
62-
IHostingEnvironment environment)
63-
#else
6457
IWebHostEnvironment environment)
65-
#endif
6658
{
6759
Guard.NotNull(options, nameof(options));
6860
Guard.NotNull(environment, nameof(environment));

src/ImageSharp.Web/Providers/WebRootImageProvider.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@ public sealed class WebRootImageProvider : FileProviderImageProvider
1616
/// <param name="environment">The web hosting environment.</param>
1717
/// <param name="formatUtilities">Contains various format helper methods based on the current configuration.</param>
1818
public WebRootImageProvider(
19-
#if NETCOREAPP2_1
20-
IHostingEnvironment environment,
21-
#else
2219
IWebHostEnvironment environment,
23-
#endif
2420
FormatUtilities formatUtilities)
2521
: base(environment.WebRootFileProvider, ProcessingBehavior.CommandOnly, formatUtilities)
2622
{

src/ImageSharp.Web/Synchronization/RefCountedConcurrentDictionary.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,8 @@ public RefCountedValue(TValue value, int refCount)
229229
public bool Equals(
230230
#if NET5_0_OR_GREATER
231231
RefCountedValue? other)
232-
#elif NETCOREAPP3_1_OR_GREATER
233-
[System.Diagnostics.CodeAnalysis.AllowNull] RefCountedValue other)
234232
#else
235-
RefCountedValue other)
233+
[System.Diagnostics.CodeAnalysis.AllowNull] RefCountedValue other)
236234
#endif
237235
=> (other != null) && (this.RefCount == other.RefCount) && EqualityComparer<TValue>.Default.Equals(this.Value, other.Value);
238236

0 commit comments

Comments
 (0)