Skip to content

Commit c901922

Browse files
author
Ruoyun Tang
committed
add IHttpRequestPathFeature.CurrentExecutionFilePath
1 parent 15c566c commit c901922

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

src/Microsoft.AspNetCore.SystemWebAdapters.CoreServices/HttpRequestInputStreamFeature.cs

+2
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ void IHttpRequestPathFeature.Rewrite(string filePath, string pathInfo, string? q
215215

216216
string IHttpRequestPathFeature.RawUrl => _other.RawTarget;
217217

218+
string IHttpRequestPathFeature.CurrentExecutionFilePath => _filePath ?? Path;
219+
218220
internal static class AspNetCoreTempDirectory
219221
{
220222
private static string? _tempDirectory;

src/Microsoft.AspNetCore.SystemWebAdapters/Adapters/IHttpRequestPathFeature.cs

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ internal interface IHttpRequestPathFeature
1313

1414
string RawUrl { get; }
1515

16+
string CurrentExecutionFilePath { get; }
17+
1618
void Rewrite(string filePath, string pathInfo, string? queryString, bool setClientFilePath);
1719
}
1820

src/Microsoft.AspNetCore.SystemWebAdapters/Generated/Ref.Standard.cs

+1
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ internal HttpRequest() { }
337337
public int ContentLength { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
338338
public string ContentType { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} set { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
339339
public System.Web.HttpCookieCollection Cookies { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
340+
public string CurrentExecutionFilePath { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
340341
public string FilePath { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
341342
public System.Web.HttpFileCollection Files { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
342343
public System.Collections.Specialized.NameValueCollection Form { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }

src/Microsoft.AspNetCore.SystemWebAdapters/HttpRequest.cs

+2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ internal HttpRequest(HttpRequestCore request)
5252
[SuppressMessage("Design", "CA1056:URI-like properties should not be strings", Justification = Constants.ApiFromAspNet)]
5353
public string RawUrl => _request.HttpContext.Features.GetRequired<IHttpRequestPathFeature>().RawUrl;
5454

55+
public string CurrentExecutionFilePath => _request.HttpContext.Features.GetRequired<IHttpRequestPathFeature>().CurrentExecutionFilePath;
56+
5557
public NameValueCollection Headers => _headers ??= _request.Headers.ToNameValueCollection();
5658

5759
public Uri Url => new(_request.GetEncodedUrl());

0 commit comments

Comments
 (0)