Skip to content

Commit

Permalink
Merge in 'release/8.0' changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dotnet-bot committed Feb 14, 2024
2 parents 9cd97f4 + 9ee54e5 commit a244ff1
Show file tree
Hide file tree
Showing 66 changed files with 1,604 additions and 604 deletions.
502 changes: 251 additions & 251 deletions eng/Baseline.Designer.props

Large diffs are not rendered by default.

212 changes: 106 additions & 106 deletions eng/Baseline.xml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions eng/Dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ and are generated based on the last package release.

<ItemGroup Label="External dependencies" Condition="'$(DotNetBuildFromSource)' != 'true'">
<LatestPackageReference Include="AngleSharp" />
<LatestPackageReference Include="Azure.Identity" />
<LatestPackageReference Include="BenchmarkDotNet" />
<LatestPackageReference Include="CommandLineParser" />
<LatestPackageReference Include="FSharp.Core" />
Expand Down
2 changes: 1 addition & 1 deletion eng/Tools.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Since this project is evaluated before .npmproj files are loaded, this should cause the package to end up in
the NuGet cache ahead of time. This is not needed in source build.
-->
<PackageReference Include="Yarn.MSBuild" Version="1.22.10" />
<PackageReference Include="Yarn.MSBuild" Version="1.22.19" />
</ItemGroup>

<!-- Update the generated files when we restore projects. Skip in desktop msbuild due to VS 16.8 requirements. -->
Expand Down
9 changes: 5 additions & 4 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<PropertyGroup Label="Version settings">
<AspNetCoreMajorVersion>8</AspNetCoreMajorVersion>
<AspNetCoreMinorVersion>0</AspNetCoreMinorVersion>
<AspNetCorePatchVersion>2</AspNetCorePatchVersion>
<AspNetCorePatchVersion>3</AspNetCorePatchVersion>
<PreReleaseVersionIteration>
</PreReleaseVersionIteration>
<ValidateBaseline>true</ValidateBaseline>
Expand Down Expand Up @@ -285,6 +285,7 @@
<MicrosoftAspNetCoreAzureAppServicesSiteExtension70x64Version>$(MicrosoftAspNetCoreAzureAppServicesSiteExtension70Version)</MicrosoftAspNetCoreAzureAppServicesSiteExtension70x64Version>
<MicrosoftAspNetCoreAzureAppServicesSiteExtension70x86Version>$(MicrosoftAspNetCoreAzureAppServicesSiteExtension70Version)</MicrosoftAspNetCoreAzureAppServicesSiteExtension70x86Version>
<!-- 3rd party dependencies -->
<AzureIdentityVersion>1.10.2</AzureIdentityVersion>
<AngleSharpVersion>0.9.9</AngleSharpVersion>
<BenchmarkDotNetVersion>0.13.0</BenchmarkDotNetVersion>
<CastleCoreVersion>4.2.1</CastleCoreVersion>
Expand Down Expand Up @@ -313,8 +314,8 @@
<MicrosoftPlaywrightVersion>1.28.0</MicrosoftPlaywrightVersion>
<PollyExtensionsHttpVersion>3.0.0</PollyExtensionsHttpVersion>
<PollyVersion>7.2.4</PollyVersion>
<SeleniumSupportVersion>4.14.1</SeleniumSupportVersion>
<SeleniumWebDriverVersion>4.14.1</SeleniumWebDriverVersion>
<SeleniumSupportVersion>4.17.0</SeleniumSupportVersion>
<SeleniumWebDriverVersion>4.17.0</SeleniumWebDriverVersion>
<SerilogExtensionsLoggingVersion>1.4.0</SerilogExtensionsLoggingVersion>
<SerilogSinksFileVersion>4.0.0</SerilogSinksFileVersion>
<StackExchangeRedisVersion>2.6.122</StackExchangeRedisVersion>
Expand All @@ -327,7 +328,7 @@
<XunitExtensibilityCoreVersion>$(XunitVersion)</XunitExtensibilityCoreVersion>
<XunitExtensibilityExecutionVersion>$(XunitVersion)</XunitExtensibilityExecutionVersion>
<XUnitRunnerVisualStudioVersion>2.4.3</XUnitRunnerVisualStudioVersion>
<MicrosoftDataSqlClientVersion>4.0.1</MicrosoftDataSqlClientVersion>
<MicrosoftDataSqlClientVersion>4.0.5</MicrosoftDataSqlClientVersion>
<MicrosoftAspNetCoreAppVersion>6.0.0-preview.3.21167.1</MicrosoftAspNetCoreAppVersion>
<MicrosoftOpenApiVersion>1.4.3</MicrosoftOpenApiVersion>
<!-- dotnet tool versions (see also auto-updated DotnetEfVersion property). -->
Expand Down
2 changes: 1 addition & 1 deletion eng/targets/Wix.Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
<ProductVersion>3.14</ProductVersion>
<WixVersion>1.0.0-v3.14.0.5722</WixVersion>
<WixVersion>3.14.0-8606.20240208.1</WixVersion>
</PropertyGroup>

<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion eng/tools/RepoTasks/RepoTasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net472'">
<PackageReference Include="Microsoft.Signed.Wix" Version="1.0.0-v3.14.0.5722" />
<PackageReference Include="Microsoft.Signed.Wix" Version="3.14.0-8606.20240208.1" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />

<Reference Include="Microsoft.Build" />
Expand Down
6 changes: 3 additions & 3 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"sdk": {
"version": "8.0.101"
"version": "8.0.102"
},
"tools": {
"dotnet": "8.0.101",
"dotnet": "8.0.102",
"runtimes": {
"dotnet/x86": [
"$(MicrosoftNETCoreBrowserDebugHostTransportVersion)"
Expand All @@ -26,7 +26,7 @@
"xcopy-msbuild": "17.1.0"
},
"msbuild-sdks": {
"Yarn.MSBuild": "1.22.10",
"Yarn.MSBuild": "1.22.19",
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24059.4",
"Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.24059.4"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<Reference Include="Microsoft.Extensions.Caching.Abstractions" />
<Reference Include="Microsoft.Extensions.Options" />
<Reference Include="Microsoft.Data.SqlClient" />
<Reference Include="Azure.Identity" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
<Compile Include="$(ComponentsSharedSourceRoot)src\HotReloadManager.cs" LinkBase="HotReload" />
<Compile Include="$(SharedSourceRoot)LinkerFlags.cs" LinkBase="Shared" />
<Compile Include="$(SharedSourceRoot)QueryStringEnumerable.cs" LinkBase="Shared" />
<Compile Include="$(SharedSourceRoot)UrlDecoder\UrlDecoder.cs" LinkBase="Shared" />
</ItemGroup>

<Import Project="Microsoft.AspNetCore.Components.Routing.targets" />

<ItemGroup>
<Reference Include="Microsoft.Extensions.Logging.Abstractions" />
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions" />
Expand Down
9 changes: 9 additions & 0 deletions src/Components/Components/src/RenderTree/Renderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,15 @@ private void HandleExceptionViaErrorBoundary(Exception error, ComponentState? er
// already on the sync context (and if not, we have a bug we want to know about).
Dispatcher.AssertAccess();

// We don't allow NavigationException instances to be caught by error boundaries.
// These are special exceptions whose purpose is to be as invisible as possible to
// user code and bubble all the way up to get handled by the framework as a redirect.
if (error is NavigationException)
{
HandleException(error);
return;
}

// Find the closest error boundary, if any
var candidate = errorSourceOrNull;
while (candidate is not null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,4 @@ public void ReadParametersFromQuery(ReadOnlyMemory<char> query)

return default;
}

public static bool CanSupplyValueForType(Type targetType)
{
var elementType = targetType.IsArray ? targetType.GetElementType()! : targetType;
return UrlValueConstraint.TryGetByTargetType(elementType, out _);
}
}
50 changes: 49 additions & 1 deletion src/Components/Components/src/Routing/RouteContext.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Buffers;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Text;
using Microsoft.AspNetCore.Internal;
using Microsoft.AspNetCore.Routing.Tree;
using static Microsoft.AspNetCore.Internal.LinkerFlags;

Expand All @@ -11,7 +15,28 @@ internal sealed class RouteContext
{
public RouteContext(string path)
{
Path = Uri.UnescapeDataString(path);
Path = path.Contains('%') ? GetDecodedPath(path) : path;

[SkipLocalsInit]
static string GetDecodedPath(string path)
{
using var uriBuffer = path.Length < 128 ?
new UriBuffer(stackalloc byte[path.Length]) :
new UriBuffer(path.Length);

var utf8Span = uriBuffer.Buffer;

if (Encoding.UTF8.TryGetBytes(path.AsSpan(), utf8Span, out var written))
{
utf8Span = utf8Span[..written];
var decodedLength = UrlDecoder.DecodeInPlace(utf8Span, isFormEncoding: false);
utf8Span = utf8Span[..decodedLength];
path = Encoding.UTF8.GetString(utf8Span);
return path;
}

return path;
}
}

public string Path { get; set; }
Expand All @@ -24,4 +49,27 @@ public RouteContext(string path)
public Type? Handler => Entry?.Handler;

public IReadOnlyDictionary<string, object?>? Parameters => RouteValues;

private readonly ref struct UriBuffer
{
private readonly byte[]? _pooled;

public Span<byte> Buffer { get; }

public UriBuffer(int length)
{
_pooled = ArrayPool<byte>.Shared.Rent(length);
Buffer = _pooled.AsSpan(0, length);
}

public UriBuffer(Span<byte> buffer) => Buffer = buffer;

public void Dispose()
{
if (_pooled != null)
{
ArrayPool<byte>.Shared.Return(_pooled);
}
}
}
}
25 changes: 25 additions & 0 deletions src/Components/Components/src/Routing/RouteTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ internal static RouteData ProcessParameters(RouteData endpointRouteData)
((Type page, string template) key) => RouteTableFactory.CreateEntry(key.page, key.template));

var routeValueDictionary = new RouteValueDictionary(endpointRouteData.RouteValues);
foreach (var kvp in endpointRouteData.RouteValues)
{
if (kvp.Value is string value)
{
// At this point the values have already been URL decoded, but we might not have decoded '/' characters.
// as that can cause issues when routing the request (You wouldn't be able to accept parameters that contained '/').
// To be consistent with existing Blazor quirks that used Uri.UnescapeDataString, we'll replace %2F with /.
// We don't want to call Uri.UnescapeDataString here as that would decode other characters that we don't want to decode,
// for example, any value that was "double" encoded (for whatever reason) within the original URL.
routeValueDictionary[kvp.Key] = value.Replace("%2F", "/", StringComparison.OrdinalIgnoreCase);
}
}
ProcessParameters(entry, routeValueDictionary);
return new RouteData(endpointRouteData.PageType, routeValueDictionary)
{
Expand Down Expand Up @@ -66,6 +78,19 @@ private static void ProcessParameters(InboundRouteEntry entry, RouteValueDiction
}
}

foreach (var kvp in routeValues)
{
if (kvp.Value is string value)
{
// At this point the values have already been URL decoded, but we might not have decoded '/' characters.
// as that can cause issues when routing the request (You wouldn't be able to accept parameters that contained '/').
// To be consistent with existing Blazor quirks that used Uri.UnescapeDataString, we'll replace %2F with /.
// We don't want to call Uri.UnescapeDataString here as that would decode other characters that we don't want to decode,
// for example, any value that was "double" encoded (for whatever reason) within the original URL.
routeValues[kvp.Key] = value.Replace("%2F", "/", StringComparison.OrdinalIgnoreCase);
}
}

foreach (var parameter in entry.RoutePattern.Parameters)
{
// Add null values for optional route parameters that weren't provided.
Expand Down
Loading

0 comments on commit a244ff1

Please sign in to comment.