Improve Central Package Management, update dependencies and fix package validation/MSBuild warnings (#15362)

* Use version overrides for ImageSharp 2

* Move Directory.Packages.props to root, use GlobalPackageReference and replace Microsoft.CSharp with Microsoft.CodeAnalysis.CSharp

* Replace NPoco.SqlServer with NPoco and remove unused System dependencies

* Fix package validation and MSBuild warnings

* Add nuget.config and enable package source mapping

* Remove explicitly set C# language version

* Add empty Directory.Packages.props file for acceptance test

* Downgrade SixLabors.ImageSharp back to 3.0.2 because of breaking changes

* Update ImageSharp/ImageSharp.Web to 3.1.0 and use ComputeHMAC
This commit is contained in:
Ronald Barendse
2023-12-06 08:19:46 +01:00
committed by GitHub
parent a6b53b0a93
commit 8fefca557f
21 changed files with 142 additions and 107 deletions

View File

@@ -130,11 +130,7 @@ public sealed class ImageSharpImageUrlGenerator : IImageUrlGenerator
{
var uri = QueryHelpers.AddQueryString(options.ImageUrl, queryString);
// It's important that we call the async version here.
// This is because if we call the synchronous version, we ImageSharp will start a new Task ever single time.
// This becomes a huge problem if the site is under load, and will result in massive spikes in response time.
// See https://github.com/SixLabors/ImageSharp.Web/blob/main/src/ImageSharp.Web/AsyncHelper.cs#L24
var token = _requestAuthorizationUtilities.ComputeHMACAsync(uri, CommandHandling.Sanitize).GetAwaiter().GetResult();
var token = _requestAuthorizationUtilities.ComputeHMAC(uri, CommandHandling.Sanitize);
if (string.IsNullOrEmpty(token) is false)
{
queryString.Add(RequestAuthorizationUtilities.TokenCommand, token);