6 implementations of IHttpRequestFeature
Microsoft.AspNetCore.Hosting.Tests (1)
WebHostTests.cs (1)
1368private class StubFeatures : IHttpRequestFeature, IHttpResponseFeature, IHeaderDictionary
Microsoft.AspNetCore.Http (1)
Features\HttpRequestFeature.cs (1)
9public class HttpRequestFeature : IHttpRequestFeature
Microsoft.AspNetCore.Owin (1)
OwinFeatureCollection.cs (1)
25IHttpRequestFeature,
Microsoft.AspNetCore.Server.HttpSys (1)
RequestProcessing\RequestContext.FeatureCollection.cs (1)
20IHttpRequestFeature,
Microsoft.AspNetCore.Server.IIS (1)
Core\IISHttpContext.FeatureCollection.cs (1)
24IHttpRequestFeature,
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Internal\Http\HttpProtocol.Generated.cs (1)
22IHttpRequestFeature,
183 references to IHttpRequestFeature
InMemory.FunctionalTests (13)
Http2\Http2StreamTests.cs (2)
362context.Response.Headers["rawtarget"] = context.Features.Get<IHttpRequestFeature>().RawTarget; 407Assert.Equal(input, context.Features.Get<IHttpRequestFeature>().RawTarget);
Http2\Http2TestBase.cs (3)
194_receivedRequestFields.RawTarget = context.Features.Get<IHttpRequestFeature>().RawTarget; 221_receivedRequestFields.RawTarget = context.Features.Get<IHttpRequestFeature>().RawTarget; 373context.Response.Headers["rawtarget"] = context.Features.Get<IHttpRequestFeature>().RawTarget;
Http3\Http3StreamTests.cs (2)
210context.Response.Headers["rawtarget"] = context.Features.Get<IHttpRequestFeature>().RawTarget; 244Assert.Equal(input, context.Features.Get<IHttpRequestFeature>().RawTarget);
Http3\Http3TestBase.cs (1)
104context.Response.Headers["rawtarget"] = context.Features.Get<IHttpRequestFeature>().RawTarget;
RequestTargetProcessingTests.cs (2)
69Assert.Equal(requestTarget, context.Features.Get<IHttpRequestFeature>().RawTarget); 101Assert.Equal(requestTarget, context.Features.Get<IHttpRequestFeature>().RawTarget);
RequestTests.cs (3)
239rawTargetTcs.TrySetResult(context.Features.Get<IHttpRequestFeature>().RawTarget); 1308var requestFeature = httpContext.Features.Get<IHttpRequestFeature>();
InProcessWebSite (2)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (2)
301ctx.Features.Get<IHttpRequestFeature>().Headers = headers; 302Assert.Same(headers, ctx.Features.Get<IHttpRequestFeature>().Headers);
Microsoft.AspNetCore.Hosting.Tests (11)
HostingApplicationDiagnosticsTests.cs (10)
730features.Set<IHttpRequestFeature>(new HttpRequestFeature() 761features.Set<IHttpRequestFeature>(new HttpRequestFeature() 790features.Set<IHttpRequestFeature>(new HttpRequestFeature() 820features.Set<IHttpRequestFeature>(new HttpRequestFeature() 851features.Set<IHttpRequestFeature>(new HttpRequestFeature() 888features.Set<IHttpRequestFeature>(new HttpRequestFeature() 917features.Set<IHttpRequestFeature>(new HttpRequestFeature() 959features.Set<IHttpRequestFeature>(new HttpRequestFeature() 1027features.Set<IHttpRequestFeature>(new HttpRequestFeature() 1091features.Set<IHttpRequestFeature>(new HttpRequestFeature());
WebHostTests.cs (1)
1242features.Set<IHttpRequestFeature>(stub);
Microsoft.AspNetCore.Http (14)
DefaultHttpContext.cs (1)
54Features.Set<IHttpRequestFeature>(new HttpRequestFeature());
Features\HttpRequestFeature.cs (1)
7/// Default implementation for <see cref="IHttpRequestFeature"/>.
Features\QueryFeature.cs (3)
17private static readonly Func<IFeatureCollection, IHttpRequestFeature?> _nullRequestFeature = f => null; 19private FeatureReferences<IHttpRequestFeature> _features; 46private IHttpRequestFeature HttpRequestFeature =>
Features\RequestCookiesFeature.cs (3)
15private static readonly Func<IFeatureCollection, IHttpRequestFeature?> _nullRequestFeature = f => null; 17private FeatureReferences<IHttpRequestFeature> _features; 43private IHttpRequestFeature HttpRequestFeature =>
Internal\DefaultHttpRequest.cs (3)
16private static readonly Func<IFeatureCollection, IHttpRequestFeature?> _nullRequestFeature = f => null; 49private IHttpRequestFeature HttpRequestFeature => 179public IHttpRequestFeature? Request;
Internal\DefaultWebSocketManager.cs (3)
13private static readonly Func<IFeatureCollection, IHttpRequestFeature?> _nullRequestFeature = f => null; 39private IHttpRequestFeature HttpRequestFeature => 79public IHttpRequestFeature? Request;
Microsoft.AspNetCore.Http.Connections (3)
Internal\HttpConnectionDispatcher.cs (3)
714var existingRequestFeature = context.Features.GetRequiredFeature<IHttpRequestFeature>(); 749features.Set<IHttpRequestFeature>(requestFeature);
Microsoft.AspNetCore.Http.Features (2)
IHttpBodyControlFeature.cs (2)
7/// Controls the IO behavior for the <see cref="IHttpRequestFeature.Body"/> and <see cref="IHttpResponseFeature.Body"/> 12/// Gets or sets a value that controls whether synchronous IO is allowed for the <see cref="IHttpRequestFeature.Body"/> and <see cref="IHttpResponseFeature.Body"/>
Microsoft.AspNetCore.Http.Tests (21)
DefaultHttpContextTests.cs (2)
153features.Set<IHttpRequestFeature>(new HttpRequestFeature()); 173newFeatures.Set<IHttpRequestFeature>(new HttpRequestFeature());
Features\QueryFeatureTests.cs (16)
13features[typeof(IHttpRequestFeature)] = new HttpRequestFeature { QueryString = "foo=bar" }; 30features[typeof(IHttpRequestFeature)] = new HttpRequestFeature { QueryString = queryString }; 50features[typeof(IHttpRequestFeature)] = new HttpRequestFeature { QueryString = queryString }; 67features[typeof(IHttpRequestFeature)] = new HttpRequestFeature { QueryString = queryString }; 80features[typeof(IHttpRequestFeature)] = new HttpRequestFeature { QueryString = "?=value1&=" }; 94features[typeof(IHttpRequestFeature)] = new HttpRequestFeature { QueryString = "?key1=valueA&key2=valueB&key1=valueC" }; 109features[typeof(IHttpRequestFeature)] = new HttpRequestFeature { QueryString = "?key1=valueA&key2=valueB&key1=valueC&key1=valueD" }; 124features[typeof(IHttpRequestFeature)] = new HttpRequestFeature { QueryString = "?key1=&key2=" }; 142features[typeof(IHttpRequestFeature)] = new HttpRequestFeature { QueryString = queryString }; 155features[typeof(IHttpRequestFeature)] = new HttpRequestFeature { QueryString = "?fields+%5BtodoItems%5D" }; 169features[typeof(IHttpRequestFeature)] = new HttpRequestFeature { QueryString = "?=fields+%5BtodoItems%5D" }; 183features[typeof(IHttpRequestFeature)] = new HttpRequestFeature { QueryString = "?fields+%5BtodoItems%5D=" }; 197features[typeof(IHttpRequestFeature)] = new HttpRequestFeature { QueryString = "?fields+%5BtodoItems%5D=%5B+1+%5D" }; 211features[typeof(IHttpRequestFeature)] = new HttpRequestFeature { QueryString = "?fields+%5BtodoItems%5D=%5B+1+%5D&fields+%5BtodoItems%5D=%5B+2+%5D" }; 226features[typeof(IHttpRequestFeature)] = new HttpRequestFeature 245features[typeof(IHttpRequestFeature)] = new HttpRequestFeature { QueryString = "?key=1&Key=2&key=3&Key=4&KEy=5" };
Internal\DefaultHttpRequestTests.cs (3)
138var requestFeature = request.HttpContext.Features.Get<IHttpRequestFeature>(); 349context.Features.Get<IHttpRequestFeature>().Headers = headers;
Microsoft.AspNetCore.Owin (21)
OwinEnvironment.cs (10)
40if (context.Features.Get<IHttpRequestFeature>() == null) 42throw new ArgumentException("Missing required feature: " + nameof(IHttpRequestFeature) + ".", nameof(context)); 52{ OwinConstants.RequestProtocol, new FeatureMap<IHttpRequestFeature>(feature => feature.Protocol, () => string.Empty, (feature, value) => feature.Protocol = Convert.ToString(value, CultureInfo.InvariantCulture)) }, 53{ OwinConstants.RequestScheme, new FeatureMap<IHttpRequestFeature>(feature => feature.Scheme, () => string.Empty, (feature, value) => feature.Scheme = Convert.ToString(value, CultureInfo.InvariantCulture)) }, 54{ OwinConstants.RequestMethod, new FeatureMap<IHttpRequestFeature>(feature => feature.Method, () => string.Empty, (feature, value) => feature.Method = Convert.ToString(value, CultureInfo.InvariantCulture)) }, 55{ OwinConstants.RequestPathBase, new FeatureMap<IHttpRequestFeature>(feature => feature.PathBase, () => string.Empty, (feature, value) => feature.PathBase = Convert.ToString(value, CultureInfo.InvariantCulture)) }, 56{ OwinConstants.RequestPath, new FeatureMap<IHttpRequestFeature>(feature => feature.Path, () => string.Empty, (feature, value) => feature.Path = Convert.ToString(value, CultureInfo.InvariantCulture)) }, 57{ OwinConstants.RequestQueryString, new FeatureMap<IHttpRequestFeature>(feature => Utilities.RemoveQuestionMark(feature.QueryString), () => string.Empty, 59{ OwinConstants.RequestHeaders, new FeatureMap<IHttpRequestFeature>(feature => Utilities.MakeDictionaryStringArray(feature.Headers), (feature, value) => feature.Headers = Utilities.MakeHeaderDictionary((IDictionary<string, string[]>)value)) }, 60{ OwinConstants.RequestBody, new FeatureMap<IHttpRequestFeature>(feature => feature.Body, () => Stream.Null, (feature, value) => feature.Body = (Stream)value) },
OwinFeatureCollection.cs (11)
75string IHttpRequestFeature.Protocol 81string IHttpRequestFeature.Scheme 87string IHttpRequestFeature.Method 93string IHttpRequestFeature.PathBase 99string IHttpRequestFeature.Path 105string IHttpRequestFeature.QueryString 111string IHttpRequestFeature.RawTarget 117IHeaderDictionary IHttpRequestFeature.Headers 129Stream IHttpRequestFeature.Body 245if (string.Equals("https", ((IHttpRequestFeature)this).Scheme, StringComparison.OrdinalIgnoreCase) 400yield return new KeyValuePair<Type, object>(typeof(IHttpRequestFeature), this);
Microsoft.AspNetCore.Owin.Tests (4)
OwinFeatureCollectionTests.cs (4)
34var requestFeature = Get<IHttpRequestFeature>(features); 53var requestFeature = Get<IHttpRequestFeature>(features);
Microsoft.AspNetCore.RequestDecompression.Microbenchmarks (1)
RequestDecompressionMiddlewareBenchmark.cs (1)
56features.Set<IHttpRequestFeature>(new HttpRequestFeature());
Microsoft.AspNetCore.ResponseCaching.Microbenchmarks (1)
ResponseCachingBenchmark.cs (1)
87features.Set<IHttpRequestFeature>(new HttpRequestFeature());
Microsoft.AspNetCore.Rewrite (1)
PatternSegments\ServerProtocolSegment.cs (1)
12return context.HttpContext.Features.Get<IHttpRequestFeature>()?.Protocol;
Microsoft.AspNetCore.Rewrite.Tests (1)
PatternSegments\ServerProtocolSegmentTests.cs (1)
18context.HttpContext.Features.Set<IHttpRequestFeature>(new HttpRequestFeature { Protocol = "http" });
Microsoft.AspNetCore.Server.HttpSys (10)
RequestProcessing\RequestContext.FeatureCollection.cs (9)
156Stream IHttpRequestFeature.Body 174IHeaderDictionary IHttpRequestFeature.Headers 180string IHttpRequestFeature.Method 186string IHttpRequestFeature.Path 192string IHttpRequestFeature.PathBase 198string IHttpRequestFeature.Protocol 216string IHttpRequestFeature.QueryString 222string IHttpRequestFeature.RawTarget 228string IHttpRequestFeature.Scheme
StandardFeatureCollection.cs (1)
16{ typeof(IHttpRequestFeature), _identityFunc },
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (22)
RequestTests.cs (22)
28var requestInfo = httpContext.Features.Get<IHttpRequestFeature>(); 77var requestInfo = httpContext.Features.Get<IHttpRequestFeature>(); 141var requestInfo = httpContext.Features.Get<IHttpRequestFeature>(); 212var requestInfo = httpContext.Features.Get<IHttpRequestFeature>(); 246var requestInfo = httpContext.Features.Get<IHttpRequestFeature>(); 263var requestInfo = httpContext.Features.Get<IHttpRequestFeature>(); 312var requestInfo = httpContext.Features.Get<IHttpRequestFeature>(); 351var requestInfo = httpContext.Features.Get<IHttpRequestFeature>(); 408var requestInfo = httpContext.Features.Get<IHttpRequestFeature>(); 432var requestInfo = httpContext.Features.Get<IHttpRequestFeature>(); 453var requestInfo = httpContext.Features.Get<IHttpRequestFeature>();
Microsoft.AspNetCore.Server.IIS (10)
Core\IISHttpContext.FeatureCollection.cs (9)
107string IHttpRequestFeature.Protocol 113string IHttpRequestFeature.Scheme 119string IHttpRequestFeature.Method 125string IHttpRequestFeature.PathBase 131string IHttpRequestFeature.Path 137string IHttpRequestFeature.QueryString 143string IHttpRequestFeature.RawTarget 149IHeaderDictionary IHttpRequestFeature.Headers 155Stream IHttpRequestFeature.Body
Core\IISHttpContext.Features.cs (1)
8private static readonly Type IHttpRequestFeatureType = typeof(global::Microsoft.AspNetCore.Http.Features.IHttpRequestFeature);
Microsoft.AspNetCore.Server.Kestrel.Core (20)
Internal\Http\Http1Connection.cs (1)
334Debug.Assert(((IHttpRequestFeature)this).Method != null, "Method was not set");
Internal\Http\HttpProtocol.cs (1)
150public string MethodText => ((IHttpRequestFeature)this).Method;
Internal\Http\HttpProtocol.FeatureCollection.cs (9)
22string IHttpRequestFeature.Protocol 28string IHttpRequestFeature.Scheme 34string IHttpRequestFeature.Method 52string IHttpRequestFeature.PathBase 58string IHttpRequestFeature.Path 64string IHttpRequestFeature.QueryString 70string IHttpRequestFeature.RawTarget 76IHeaderDictionary IHttpRequestFeature.Headers 82Stream IHttpRequestFeature.Body
Internal\Http\HttpProtocol.Generated.cs (9)
41internal protected IHttpRequestFeature? _currentIHttpRequestFeature; 192if (key == typeof(IHttpRequestFeature)) 344if (key == typeof(IHttpRequestFeature)) 346_currentIHttpRequestFeature = (IHttpRequestFeature?)value; 498if (typeof(TFeature) == typeof(IHttpRequestFeature)) 500feature = Unsafe.As<IHttpRequestFeature?, TFeature?>(ref _currentIHttpRequestFeature); 658if (typeof(TFeature) == typeof(IHttpRequestFeature)) 660_currentIHttpRequestFeature = Unsafe.As<TFeature?, IHttpRequestFeature?>(ref feature); 808yield return new KeyValuePair<Type, object>(typeof(IHttpRequestFeature), _currentIHttpRequestFeature);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (7)
Http1\Http1ConnectionTests.cs (2)
160Assert.Equal("http", ((IFeatureCollection)_http1Connection).Get<IHttpRequestFeature>().Scheme); 417Assert.Equal(expectedMethod, ((IHttpRequestFeature)_http1Connection).Method);
Http1\Http1HttpProtocolFeatureCollectionTests.cs (4)
104_collection[typeof(IHttpRequestFeature)] = CreateHttp1Connection(); 134_collection.Set<IHttpRequestFeature>(CreateHttp1Connection()); 182Assert.Same(_collection.Get<IHttpRequestFeature>(), _collection[typeof(IHttpRequestFeature)]);
MessageBodyTests.cs (1)
587Assert.Equal(CoreStrings.FormatBadRequest_LengthRequiredHttp10(((IHttpRequestFeature)input.Http1Connection).Method), ex.Message);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
HttpProtocolFeatureCollection.cs (2)
26public IHttpRequestFeature Get_IHttpRequestFeature() 28return _collection.Get<IHttpRequestFeature>();
Microsoft.AspNetCore.TestHost.Tests (17)
ClientHandlerTests.cs (17)
27Assert.Equal(HttpProtocol.Http11, features.Get<IHttpRequestFeature>().Protocol); 28Assert.Equal("GET", features.Get<IHttpRequestFeature>().Method); 29Assert.Equal("https", features.Get<IHttpRequestFeature>().Scheme); 30Assert.Equal("/api/a%2Fb c", features.Get<IHttpRequestFeature>().Path); 31Assert.NotNull(features.Get<IHttpRequestFeature>().Body); 32Assert.NotNull(features.Get<IHttpRequestFeature>().Headers); 37Assert.Equal("example.com", features.Get<IHttpRequestFeature>().Headers["host"]); 76Assert.Equal(HttpProtocol.Http11, features.Get<IHttpRequestFeature>().Protocol); 77Assert.Equal("GET", features.Get<IHttpRequestFeature>().Method); 78Assert.Equal("https", features.Get<IHttpRequestFeature>().Scheme); 79Assert.Equal("/A/Path", features.Get<IHttpRequestFeature>().PathBase); 80Assert.Equal("/and/file.txt", features.Get<IHttpRequestFeature>().Path); 81Assert.Equal("?and=query", features.Get<IHttpRequestFeature>().QueryString); 82Assert.NotNull(features.Get<IHttpRequestFeature>().Body); 83Assert.NotNull(features.Get<IHttpRequestFeature>().Headers); 88Assert.Equal("example.com", features.Get<IHttpRequestFeature>().Headers["host"]); 282Assert.Equal("?and=something", features.Get<IHttpRequestFeature>().QueryString);