diff --git a/src/Microsoft.AspNetCore.SystemWebAdapters.CoreServices/HttpRequestInputStreamFeature.cs b/src/Microsoft.AspNetCore.SystemWebAdapters.CoreServices/HttpRequestInputStreamFeature.cs index 352e57873..df2dfbaf2 100644 --- a/src/Microsoft.AspNetCore.SystemWebAdapters.CoreServices/HttpRequestInputStreamFeature.cs +++ b/src/Microsoft.AspNetCore.SystemWebAdapters.CoreServices/HttpRequestInputStreamFeature.cs @@ -217,6 +217,8 @@ void IHttpRequestPathFeature.Rewrite(string filePath, string pathInfo, string? q string IHttpRequestPathFeature.CurrentExecutionFilePath => _filePath ?? Path; + string? IHttpRequestPathFeature.PhysicalPath => null; + internal static class AspNetCoreTempDirectory { private static string? _tempDirectory; diff --git a/src/Microsoft.AspNetCore.SystemWebAdapters/Adapters/IHttpRequestPathFeature.cs b/src/Microsoft.AspNetCore.SystemWebAdapters/Adapters/IHttpRequestPathFeature.cs index f14a3d02f..17f914751 100644 --- a/src/Microsoft.AspNetCore.SystemWebAdapters/Adapters/IHttpRequestPathFeature.cs +++ b/src/Microsoft.AspNetCore.SystemWebAdapters/Adapters/IHttpRequestPathFeature.cs @@ -13,6 +13,8 @@ internal interface IHttpRequestPathFeature string RawUrl { get; } + string? PhysicalPath { get; } + string CurrentExecutionFilePath { get; } void Rewrite(string filePath, string pathInfo, string? queryString, bool setClientFilePath); diff --git a/src/Microsoft.AspNetCore.SystemWebAdapters/Generated/Ref.Standard.cs b/src/Microsoft.AspNetCore.SystemWebAdapters/Generated/Ref.Standard.cs index 6398019f4..e7805008f 100644 --- a/src/Microsoft.AspNetCore.SystemWebAdapters/Generated/Ref.Standard.cs +++ b/src/Microsoft.AspNetCore.SystemWebAdapters/Generated/Ref.Standard.cs @@ -352,6 +352,7 @@ internal HttpRequest() { } public System.Collections.Specialized.NameValueCollection Params { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} } public string Path { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} } public string PathInfo { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} } + public string PhysicalPath { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} } public System.Collections.Specialized.NameValueCollection QueryString { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} } public string RawUrl { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} } public System.Web.ReadEntityBodyMode ReadEntityBodyMode { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} } @@ -393,6 +394,7 @@ public abstract partial class HttpRequestBase public virtual System.Security.Principal.IIdentity LogonUserIdentity { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} } public virtual System.Collections.Specialized.NameValueCollection Params { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} } public virtual string Path { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} } + public virtual string PhysicalPath { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} } public virtual System.Collections.Specialized.NameValueCollection QueryString { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} } public virtual string RawUrl { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} } public virtual string RequestType { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} } @@ -432,6 +434,7 @@ public partial class HttpRequestWrapper : System.Web.HttpRequestBase public override System.Security.Principal.IIdentity LogonUserIdentity { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} } public override System.Collections.Specialized.NameValueCollection Params { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} } public override string Path { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} } + public override string PhysicalPath { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} } public override System.Collections.Specialized.NameValueCollection QueryString { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} } public override string RawUrl { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} } public override string RequestType { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} } diff --git a/src/Microsoft.AspNetCore.SystemWebAdapters/HttpRequest.cs b/src/Microsoft.AspNetCore.SystemWebAdapters/HttpRequest.cs index e9a262554..8d19da687 100644 --- a/src/Microsoft.AspNetCore.SystemWebAdapters/HttpRequest.cs +++ b/src/Microsoft.AspNetCore.SystemWebAdapters/HttpRequest.cs @@ -52,6 +52,8 @@ internal HttpRequest(HttpRequestCore request) [SuppressMessage("Design", "CA1056:URI-like properties should not be strings", Justification = Constants.ApiFromAspNet)] public string RawUrl => _request.HttpContext.Features.GetRequired().RawUrl; + public string? PhysicalPath => _request.HttpContext.Features.GetRequired().PhysicalPath; + public string CurrentExecutionFilePath => _request.HttpContext.Features.GetRequired().CurrentExecutionFilePath; public NameValueCollection Headers => _headers ??= _request.Headers.ToNameValueCollection(); diff --git a/src/Microsoft.AspNetCore.SystemWebAdapters/HttpRequestBase.cs b/src/Microsoft.AspNetCore.SystemWebAdapters/HttpRequestBase.cs index 093ecea48..aff719dc4 100644 --- a/src/Microsoft.AspNetCore.SystemWebAdapters/HttpRequestBase.cs +++ b/src/Microsoft.AspNetCore.SystemWebAdapters/HttpRequestBase.cs @@ -18,6 +18,8 @@ public abstract class HttpRequestBase public virtual string Path => throw new NotImplementedException(); + public virtual string? PhysicalPath => throw new NotImplementedException(); + public virtual NameValueCollection Headers => throw new NotImplementedException(); public virtual Uri Url => throw new NotImplementedException(); diff --git a/src/Microsoft.AspNetCore.SystemWebAdapters/HttpRequestWrapper.cs b/src/Microsoft.AspNetCore.SystemWebAdapters/HttpRequestWrapper.cs index ccfc944c4..230995f82 100644 --- a/src/Microsoft.AspNetCore.SystemWebAdapters/HttpRequestWrapper.cs +++ b/src/Microsoft.AspNetCore.SystemWebAdapters/HttpRequestWrapper.cs @@ -59,6 +59,8 @@ public override string? ContentType public override string Path => _request.Path; + public override string? PhysicalPath => _request.PhysicalPath; + public override NameValueCollection QueryString => _request.QueryString; public override HttpBrowserCapabilitiesBase Browser => new HttpBrowserCapabilitiesWrapper(_request.Browser);