Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
6d524b3
Add System.Web.VirtualPathUtility
CZEMacLeod Jul 30, 2022
5eaa215
Add tests and correct a few edge cases in VirtualPathUtility
CZEMacLeod Aug 29, 2022
22d52e1
Fix null reference issues in tests
CZEMacLeod Aug 29, 2022
c259ae3
Align exceptions with framework and remove resource file
CZEMacLeod Aug 29, 2022
cbd601f
Add comment detailing reason why some data for tests is conditional o…
CZEMacLeod Aug 29, 2022
c27720e
Regenerate Ref.Standard.cs and TypeForwards.Framework.cs after mergin…
CZEMacLeod Aug 29, 2022
bc4a3fd
Clean up tabs/spaces in tests and remove some blank lines
CZEMacLeod Aug 29, 2022
0cb34b1
Work around issue with netstandard and nullability
CZEMacLeod Aug 29, 2022
71b9b91
Update src/Microsoft.AspNetCore.SystemWebAdapters/Microsoft.AspNetCor…
CZEMacLeod Aug 29, 2022
c3b6975
add excluded attributes
twsouthwick Aug 29, 2022
77cd972
Revert "Work around issue with netstandard and nullability"
CZEMacLeod Aug 29, 2022
2df2800
Add THIRD-PARTY-NOTICES.tx
twsouthwick Sep 2, 2022
cca5264
Update VPP Tests to support (I)HttpRuntime changes from #185
CZEMacLeod Sep 5, 2022
bd6cf61
Break methods back out into StringUtil and UrlPath
CZEMacLeod Sep 7, 2022
650e446
Add summaries and attribution for StringUtil and UrlPath classes
CZEMacLeod Sep 7, 2022
533e351
Add licence headers
CZEMacLeod Sep 7, 2022
f60a864
Update src/Microsoft.AspNetCore.SystemWebAdapters/Utilities/UrlPath.cs
CZEMacLeod Sep 7, 2022
7d4b4b0
Removed legacy bug references from code
CZEMacLeod Sep 7, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions THIRD-PARTY-NOTICES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.NET System Web Adapters uses third-party libraries or other resources that may be
distributed under licenses different than the .NET System Web Adapters software.

In the event that we accidentally failed to list a required notice, please
bring it to our attention. Post an issue or email us:

[email protected]

The attached notices are provided for information only.

License notice for .NET Framework
-------------------------------

Copyright (c) Microsoft Corporation
Licenses under the MIT License

Available at
https://github.com/microsoft/referencesource/blob/master/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
T:System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
<__Generate Condition="$(GenerateTypeForwards) OR $(GenerateStandard)">true</__Generate>

<GenAPIHeaderFile>$(MSBuildThisFileDirectory)\Header.txt</GenAPIHeaderFile>
<GenAPIExcludedAttributes>$(MSBuildThisFileDirectory)\ExcludedAttributes.txt</GenAPIExcludedAttributes>
<GenAPITargetPath Condition="$(GenerateTypeForwards)">$(MSBuildThisFileDirectory)\TypeForwards.Framework.cs</GenAPITargetPath>
<GenAPITargetPath Condition="!$(GenerateTypeForwards)">$(MSBuildThisFileDirectory)\Ref.Standard.cs</GenAPITargetPath>
<GenAPIAdditionalParameters>-excludeApiList $(MSBuildThisFileDirectory)ExcludedApis.txt -throw "$(PlatformNotSupportedMessage)" -HeaderFile "$(GenAPIHeaderFile)"</GenAPIAdditionalParameters>
<GenAPIAdditionalParameters>-excludeApiList $(MSBuildThisFileDirectory)ExcludedApis.txt -throw "$(PlatformNotSupportedMessage)" -HeaderFile "$(GenAPIHeaderFile)" -excludeAttributesList "$(GenAPIExcludedAttributes)"</GenAPIAdditionalParameters>
<GenAPIAdditionalParameters Condition="$(GenerateTypeForwards)">$(GenAPIAdditionalParameters) -writer TypeForwards</GenAPIAdditionalParameters>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,22 @@ public enum ReadEntityBodyMode
Classic = 1,
None = 0,
}
public static partial class VirtualPathUtility
{
public static string AppendTrailingSlash(string virtualPath) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public static string Combine(string basePath, string relativePath) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public static string GetDirectory(string virtualPath) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public static string GetExtension(string virtualPath) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public static string GetFileName(string virtualPath) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public static bool IsAbsolute(string virtualPath) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public static bool IsAppRelative(string virtualPath) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public static string MakeRelative(string fromPath, string toPath) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public static string RemoveTrailingSlash(string virtualPath) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public static string ToAbsolute(string virtualPath) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public static string ToAbsolute(string virtualPath, string applicationPath) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public static string ToAppRelative(string virtualPath) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public static string ToAppRelative(string virtualPath, string applicationPath) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
}
}
namespace System.Web.Caching
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Web.HttpUnhandledException))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Web.ISubscriptionToken))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Web.ReadEntityBodyMode))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Web.VirtualPathUtility))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Web.Caching.Cache))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Web.Caching.CacheDependency))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Web.Caching.CacheItemPriority))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
<FrameworkReference Include="Microsoft.AspNetCore.App" />

<PackageReference Include="System.Runtime.Caching" Version="6.0.0" />

<Using Include="Microsoft.AspNetCore.Http.HttpContext" Alias="HttpContextCore" />
<Using Include="Microsoft.AspNetCore.Http.HttpResponse" Alias="HttpResponseCore" />
<Using Include="Microsoft.AspNetCore.Http.HttpRequest" Alias="HttpRequestCore" />
Expand Down
26 changes: 26 additions & 0 deletions src/Microsoft.AspNetCore.SystemWebAdapters/Utilities/StringUtil.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace System.Web.Util;

/// <summary>
/// Provides utility methods for string operations.
/// </summary>
/// <remarks>
/// Portions of this code are based on code originally Copyright (c) 1999 Microsoft Corporation
/// System.Web.Util.StringUtil at https://github.com/microsoft/referencesource/blob/master/System.Web/Util/StringUtil.cs
/// These files are released under an MIT licence according to https://github.com/microsoft/referencesource#license
/// </remarks>
internal static class StringUtil
{
/*
* Determines if the first string starts with the second string, ignoring case.
* Fast, non-culture aware.
*/
internal static bool StringStartsWithIgnoreCase(string s1, string s2)
{
if (string.IsNullOrEmpty(s1) || string.IsNullOrEmpty(s2)) return false;
if (s2.Length > s1.Length) return false;
return s1.StartsWith(s2, StringComparison.OrdinalIgnoreCase);
}
}
Loading