Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Commented Unassigned: HttpRequestContext is not available when using HttpServer [1254]

$
0
0
If you are using HttpServer (not selfhost or webhost), Request.GetRequestContext() always returns null. We use HttpServer for quick in-memory testing. It would be useful to maintain same behavior for HttpServer for consistency.


Comments: Repro code, ``` public class Test { [Fact] public void TestRequestContext_HttpServer() { HttpServer server = new HttpServer(); server.Configuration.MapHttpAttributeRoutes(); HttpClient client = new HttpClient(server); var response = client.GetAsync("http://localhost/Customers").Result; response.EnsureSuccessStatusCode(); } } public class CustomersController : ApiController { [Route("Customers")] public void Get() { Assert.NotNull(Request.GetRequestContext()); } } ```

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>