Skip to content

Commit a244ff1

Browse files
committed
Merge in 'release/8.0' changes
2 parents 9cd97f4 + 9ee54e5 commit a244ff1

File tree

66 files changed

+1604
-604
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1604
-604
lines changed

eng/Baseline.Designer.props

Lines changed: 251 additions & 251 deletions
Large diffs are not rendered by default.

eng/Baseline.xml

Lines changed: 106 additions & 106 deletions
Large diffs are not rendered by default.

eng/Dependencies.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ and are generated based on the last package release.
186186

187187
<ItemGroup Label="External dependencies" Condition="'$(DotNetBuildFromSource)' != 'true'">
188188
<LatestPackageReference Include="AngleSharp" />
189+
<LatestPackageReference Include="Azure.Identity" />
189190
<LatestPackageReference Include="BenchmarkDotNet" />
190191
<LatestPackageReference Include="CommandLineParser" />
191192
<LatestPackageReference Include="FSharp.Core" />

eng/Tools.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Since this project is evaluated before .npmproj files are loaded, this should cause the package to end up in
88
the NuGet cache ahead of time. This is not needed in source build.
99
-->
10-
<PackageReference Include="Yarn.MSBuild" Version="1.22.10" />
10+
<PackageReference Include="Yarn.MSBuild" Version="1.22.19" />
1111
</ItemGroup>
1212

1313
<!-- Update the generated files when we restore projects. Skip in desktop msbuild due to VS 16.8 requirements. -->

eng/Versions.props

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<PropertyGroup Label="Version settings">
99
<AspNetCoreMajorVersion>8</AspNetCoreMajorVersion>
1010
<AspNetCoreMinorVersion>0</AspNetCoreMinorVersion>
11-
<AspNetCorePatchVersion>2</AspNetCorePatchVersion>
11+
<AspNetCorePatchVersion>3</AspNetCorePatchVersion>
1212
<PreReleaseVersionIteration>
1313
</PreReleaseVersionIteration>
1414
<ValidateBaseline>true</ValidateBaseline>
@@ -285,6 +285,7 @@
285285
<MicrosoftAspNetCoreAzureAppServicesSiteExtension70x64Version>$(MicrosoftAspNetCoreAzureAppServicesSiteExtension70Version)</MicrosoftAspNetCoreAzureAppServicesSiteExtension70x64Version>
286286
<MicrosoftAspNetCoreAzureAppServicesSiteExtension70x86Version>$(MicrosoftAspNetCoreAzureAppServicesSiteExtension70Version)</MicrosoftAspNetCoreAzureAppServicesSiteExtension70x86Version>
287287
<!-- 3rd party dependencies -->
288+
<AzureIdentityVersion>1.10.2</AzureIdentityVersion>
288289
<AngleSharpVersion>0.9.9</AngleSharpVersion>
289290
<BenchmarkDotNetVersion>0.13.0</BenchmarkDotNetVersion>
290291
<CastleCoreVersion>4.2.1</CastleCoreVersion>
@@ -313,8 +314,8 @@
313314
<MicrosoftPlaywrightVersion>1.28.0</MicrosoftPlaywrightVersion>
314315
<PollyExtensionsHttpVersion>3.0.0</PollyExtensionsHttpVersion>
315316
<PollyVersion>7.2.4</PollyVersion>
316-
<SeleniumSupportVersion>4.14.1</SeleniumSupportVersion>
317-
<SeleniumWebDriverVersion>4.14.1</SeleniumWebDriverVersion>
317+
<SeleniumSupportVersion>4.17.0</SeleniumSupportVersion>
318+
<SeleniumWebDriverVersion>4.17.0</SeleniumWebDriverVersion>
318319
<SerilogExtensionsLoggingVersion>1.4.0</SerilogExtensionsLoggingVersion>
319320
<SerilogSinksFileVersion>4.0.0</SerilogSinksFileVersion>
320321
<StackExchangeRedisVersion>2.6.122</StackExchangeRedisVersion>
@@ -327,7 +328,7 @@
327328
<XunitExtensibilityCoreVersion>$(XunitVersion)</XunitExtensibilityCoreVersion>
328329
<XunitExtensibilityExecutionVersion>$(XunitVersion)</XunitExtensibilityExecutionVersion>
329330
<XUnitRunnerVisualStudioVersion>2.4.3</XUnitRunnerVisualStudioVersion>
330-
<MicrosoftDataSqlClientVersion>4.0.1</MicrosoftDataSqlClientVersion>
331+
<MicrosoftDataSqlClientVersion>4.0.5</MicrosoftDataSqlClientVersion>
331332
<MicrosoftAspNetCoreAppVersion>6.0.0-preview.3.21167.1</MicrosoftAspNetCoreAppVersion>
332333
<MicrosoftOpenApiVersion>1.4.3</MicrosoftOpenApiVersion>
333334
<!-- dotnet tool versions (see also auto-updated DotnetEfVersion property). -->

eng/targets/Wix.Common.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<PropertyGroup>
55
<SchemaVersion>2.0</SchemaVersion>
66
<ProductVersion>3.14</ProductVersion>
7-
<WixVersion>1.0.0-v3.14.0.5722</WixVersion>
7+
<WixVersion>3.14.0-8606.20240208.1</WixVersion>
88
</PropertyGroup>
99

1010
<PropertyGroup>

eng/tools/RepoTasks/RepoTasks.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
</ItemGroup>
3535

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

4040
<Reference Include="Microsoft.Build" />

global.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"sdk": {
3-
"version": "8.0.101"
3+
"version": "8.0.102"
44
},
55
"tools": {
6-
"dotnet": "8.0.101",
6+
"dotnet": "8.0.102",
77
"runtimes": {
88
"dotnet/x86": [
99
"$(MicrosoftNETCoreBrowserDebugHostTransportVersion)"
@@ -26,7 +26,7 @@
2626
"xcopy-msbuild": "17.1.0"
2727
},
2828
"msbuild-sdks": {
29-
"Yarn.MSBuild": "1.22.10",
29+
"Yarn.MSBuild": "1.22.19",
3030
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24059.4",
3131
"Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.24059.4"
3232
}

src/Caching/SqlServer/src/Microsoft.Extensions.Caching.SqlServer.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<Reference Include="Microsoft.Extensions.Caching.Abstractions" />
2020
<Reference Include="Microsoft.Extensions.Options" />
2121
<Reference Include="Microsoft.Data.SqlClient" />
22+
<Reference Include="Azure.Identity" />
2223
</ItemGroup>
2324

2425
<ItemGroup>

src/Components/Components/src/Microsoft.AspNetCore.Components.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@
1919
<Compile Include="$(ComponentsSharedSourceRoot)src\HotReloadManager.cs" LinkBase="HotReload" />
2020
<Compile Include="$(SharedSourceRoot)LinkerFlags.cs" LinkBase="Shared" />
2121
<Compile Include="$(SharedSourceRoot)QueryStringEnumerable.cs" LinkBase="Shared" />
22+
<Compile Include="$(SharedSourceRoot)UrlDecoder\UrlDecoder.cs" LinkBase="Shared" />
2223
</ItemGroup>
2324

2425
<Import Project="Microsoft.AspNetCore.Components.Routing.targets" />
25-
26+
2627
<ItemGroup>
2728
<Reference Include="Microsoft.Extensions.Logging.Abstractions" />
2829
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions" />

src/Components/Components/src/RenderTree/Renderer.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,6 +1065,15 @@ private void HandleExceptionViaErrorBoundary(Exception error, ComponentState? er
10651065
// already on the sync context (and if not, we have a bug we want to know about).
10661066
Dispatcher.AssertAccess();
10671067

1068+
// We don't allow NavigationException instances to be caught by error boundaries.
1069+
// These are special exceptions whose purpose is to be as invisible as possible to
1070+
// user code and bubble all the way up to get handled by the framework as a redirect.
1071+
if (error is NavigationException)
1072+
{
1073+
HandleException(error);
1074+
return;
1075+
}
1076+
10681077
// Find the closest error boundary, if any
10691078
var candidate = errorSourceOrNull;
10701079
while (candidate is not null)

src/Components/Components/src/Routing/QueryParameterValueSupplier.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,4 @@ public void ReadParametersFromQuery(ReadOnlyMemory<char> query)
5151

5252
return default;
5353
}
54-
55-
public static bool CanSupplyValueForType(Type targetType)
56-
{
57-
var elementType = targetType.IsArray ? targetType.GetElementType()! : targetType;
58-
return UrlValueConstraint.TryGetByTargetType(elementType, out _);
59-
}
6054
}

src/Components/Components/src/Routing/RouteContext.cs

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4+
using System.Buffers;
45
using System.Diagnostics.CodeAnalysis;
6+
using System.Runtime.CompilerServices;
7+
using System.Text;
8+
using Microsoft.AspNetCore.Internal;
59
using Microsoft.AspNetCore.Routing.Tree;
610
using static Microsoft.AspNetCore.Internal.LinkerFlags;
711

@@ -11,7 +15,28 @@ internal sealed class RouteContext
1115
{
1216
public RouteContext(string path)
1317
{
14-
Path = Uri.UnescapeDataString(path);
18+
Path = path.Contains('%') ? GetDecodedPath(path) : path;
19+
20+
[SkipLocalsInit]
21+
static string GetDecodedPath(string path)
22+
{
23+
using var uriBuffer = path.Length < 128 ?
24+
new UriBuffer(stackalloc byte[path.Length]) :
25+
new UriBuffer(path.Length);
26+
27+
var utf8Span = uriBuffer.Buffer;
28+
29+
if (Encoding.UTF8.TryGetBytes(path.AsSpan(), utf8Span, out var written))
30+
{
31+
utf8Span = utf8Span[..written];
32+
var decodedLength = UrlDecoder.DecodeInPlace(utf8Span, isFormEncoding: false);
33+
utf8Span = utf8Span[..decodedLength];
34+
path = Encoding.UTF8.GetString(utf8Span);
35+
return path;
36+
}
37+
38+
return path;
39+
}
1540
}
1641

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

2651
public IReadOnlyDictionary<string, object?>? Parameters => RouteValues;
52+
53+
private readonly ref struct UriBuffer
54+
{
55+
private readonly byte[]? _pooled;
56+
57+
public Span<byte> Buffer { get; }
58+
59+
public UriBuffer(int length)
60+
{
61+
_pooled = ArrayPool<byte>.Shared.Rent(length);
62+
Buffer = _pooled.AsSpan(0, length);
63+
}
64+
65+
public UriBuffer(Span<byte> buffer) => Buffer = buffer;
66+
67+
public void Dispose()
68+
{
69+
if (_pooled != null)
70+
{
71+
ArrayPool<byte>.Shared.Return(_pooled);
72+
}
73+
}
74+
}
2775
}

src/Components/Components/src/Routing/RouteTable.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@ internal static RouteData ProcessParameters(RouteData endpointRouteData)
2828
((Type page, string template) key) => RouteTableFactory.CreateEntry(key.page, key.template));
2929

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

81+
foreach (var kvp in routeValues)
82+
{
83+
if (kvp.Value is string value)
84+
{
85+
// At this point the values have already been URL decoded, but we might not have decoded '/' characters.
86+
// as that can cause issues when routing the request (You wouldn't be able to accept parameters that contained '/').
87+
// To be consistent with existing Blazor quirks that used Uri.UnescapeDataString, we'll replace %2F with /.
88+
// We don't want to call Uri.UnescapeDataString here as that would decode other characters that we don't want to decode,
89+
// for example, any value that was "double" encoded (for whatever reason) within the original URL.
90+
routeValues[kvp.Key] = value.Replace("%2F", "/", StringComparison.OrdinalIgnoreCase);
91+
}
92+
}
93+
6994
foreach (var parameter in entry.RoutePattern.Parameters)
7095
{
7196
// Add null values for optional route parameters that weren't provided.

0 commit comments

Comments
 (0)