Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Commit 8a804a9

Browse files
author
Cesar Blum Silveira
committed
Add RawTarget property to IHttpRequestFeature (#596).
1 parent c63f02c commit 8a804a9

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

src/Microsoft.AspNetCore.Http.Features/IHttpRequestFeature.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,17 @@ public interface IHttpRequestFeature
4848
/// </summary>
4949
string QueryString { get; set; }
5050

51+
/// <summary>
52+
/// The request target as it was sent in the HTTP request. This property contains the
53+
/// raw path and full query, as well as other request targets such as * for OPTIONS
54+
/// requests (https://tools.ietf.org/html/rfc7230#section-5.3).
55+
/// </summary>
56+
/// <remarks>
57+
/// This property is not used internally for routing or authorization decisions. It has not
58+
/// been UrlDecoded and care should be taken in its use.
59+
/// </remarks>
60+
string RawTarget { get; set; }
61+
5162
/// <summary>
5263
/// Headers included in the request, aggregated by header name. The values are not split
5364
/// or merged across header lines. E.g. The following headers:

src/Microsoft.AspNetCore.Http/Features/HttpRequestFeature.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public HttpRequestFeature()
1717
PathBase = string.Empty;
1818
Path = string.Empty;
1919
QueryString = string.Empty;
20+
RawTarget = string.Empty;
2021
}
2122

2223
public string Protocol { get; set; }
@@ -25,6 +26,7 @@ public HttpRequestFeature()
2526
public string PathBase { get; set; }
2627
public string Path { get; set; }
2728
public string QueryString { get; set; }
29+
public string RawTarget { get; set; }
2830
public IHeaderDictionary Headers { get; set; }
2931
public Stream Body { get; set; }
3032
}

src/Microsoft.AspNetCore.Owin/OwinFeatureCollection.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ string IHttpRequestFeature.QueryString
102102
set { Prop(OwinConstants.RequestQueryString, Utilities.RemoveQuestionMark(value)); }
103103
}
104104

105+
string IHttpRequestFeature.RawTarget
106+
{
107+
get { return string.Empty; }
108+
set { throw new NotSupportedException(); }
109+
}
110+
105111
IHeaderDictionary IHttpRequestFeature.Headers
106112
{
107113
get { return Utilities.MakeHeaderDictionary(Prop<IDictionary<string, string[]>>(OwinConstants.RequestHeaders)); }

0 commit comments

Comments
 (0)