Commit Graph

14 Commits

Author SHA1 Message Date
Ben Adams 49d785c934 Use object indirection in HttpContextAccessor (#1066) 2018-11-15 22:34:44 -08:00
David Fowler 0f4f1950f1
Attempt to make it easier to detect when the request is done (#1021)
- Today the async local reference to the HttpContext flows when the execution context is captured. When the http request has ended, the HttpContext property will return the reference to an invalid HttpContext instead of returning null. This change stores both the request id and the HttpContext and makes sure both match before returning anything valid.
- This is still racy but should catch more cases of people doing bad things.
- There will still be issue if people store the context in a local and use that reference instead of accessing it through the property getter but we can live with that.
- Set the TraceIdentifier to null in the default HttpContextFactory
- Added tests
2018-06-26 11:49:12 -07:00
David Fowler 9bf94d3667 Remove unused parameter in ctor of HttpContextFactory (#881)
- We removed the use of the ObjectPoolProvider in 1.x, this change
just removes it from the ctor.
2017-06-29 11:44:46 -07:00
John Luo 9168442704 Migration 2017-05-05 14:59:10 -07:00
Pranav K b3b846c27e Remove net451 as a cross-compile target 2017-03-24 11:46:13 -07:00
Kiran Challa 50f3cd6877 Changed samples and tests to run on netcoreapp2.0 2017-03-21 13:25:34 -07:00
Doug Bunting d4800d188a Bump test projects up to .NET 4.5.2
- aspnet/Testing#248
- xUnit no longer supports .NET 4.5.1
- build tests for desktop .NET only on Windows
2017-02-14 08:37:12 -08:00
Chris R 96f33b27d4 Migrate from xproj to csproj 2017-02-03 15:37:51 -08:00
BrennanConroy 9a0ea424ea Fix cross appdomain exception 2016-07-25 09:48:10 -07:00
Chris R 13f73c6101 Make the form body limits configurable. 2016-04-25 11:59:40 -07:00
Doug Bunting 6725d68559 Move some implementations (all feature implementations) out of `.Internal` namespaces
- #549, #592
- move feature implementations to `Microsoft.AspNetCore.Http.Features` and `...Authentication.Features`
- move `DefaultHttpContext`, `HttpContextAccessor`, `HttpContextFactory`, `FormCollection` and
  `HeaderDictionary` to `Microsoft.AspNetCore.Http`
- move `FormFile` to `Microsoft.AspNetCore.Http.Internal`
 - that and `Microsoft.AspNetCore.Http.Authentication.Internal` are the remaining `.Internal` namespaces

nits:
- remove a couple of parameterless constructors
- add / fill subfolders to align with new namespaces
- remove all use of (unnecessary) "T:..." `<see cref=""/>` values
2016-03-30 16:01:37 -07:00
Doug Bunting 80813f7c1e Use pooled `StringBuilder` to reduce allocations when adding response cookies
- #561
- new `SetCookieHeaderValue.AppendToStringBuilder()` method; avoids per-call `StringBuilder` allocation
- `ResponseCookies` uses `ObjectPool<StringBuilder>` that `ResponseCookiesFeature` provides
 - `ResponseCookies` works fine if no `ObjectPoolProvider` is available
- `IHttpContextFactory` instance is a singleton instantiated from CI
 - make `HttpContextFactory` `ObjectPoolProvider` and `ResponseCookiesFeature`-aware
 - apply same pattern to sample `PooledHttpContextFactory`
- pool is not currently configurable; defaults are fine for response cookies
 - if we need (policy) configuration, would add an `IOptions<HttpContextFactorySettings>`

nit: Add some doc comments
2016-03-25 09:38:52 -07:00
N. Taylor Mullen 02363da94e Rename AspNet 5 file contents.
See https://github.com/aspnet/Announcements/issues/144 for more information.
2016-01-22 12:20:40 -08:00
N. Taylor Mullen b2c154b576 Rename AspNet 5 folders and files.
See https://github.com/aspnet/Announcements/issues/144 for more information.
2016-01-22 12:20:30 -08:00