parent
ed5a43d5ad
commit
10d5a0ba62
|
|
@ -7,7 +7,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Contains methods to verify the request method of an HTTP request.
|
/// Contains methods to verify the request method of an HTTP request.
|
||||||
/// <summary/>
|
/// </summary>
|
||||||
public static class HttpMethods
|
public static class HttpMethods
|
||||||
{
|
{
|
||||||
// We are intentionally using 'static readonly' here instead of 'const'.
|
// We are intentionally using 'static readonly' here instead of 'const'.
|
||||||
|
|
@ -30,7 +30,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a value that indicates if the HTTP request method is CONNECT.
|
/// Returns a value that indicates if the HTTP request method is CONNECT.
|
||||||
/// <summary/>
|
/// </summary>
|
||||||
/// <param name="method">The HTTP request method.</param>
|
/// <param name="method">The HTTP request method.</param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// <see langword="true" /> if the method is CONNECT; otherwise, <see langword="false" />.
|
/// <see langword="true" /> if the method is CONNECT; otherwise, <see langword="false" />.
|
||||||
|
|
@ -42,7 +42,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a value that indicates if the HTTP request method is DELETE.
|
/// Returns a value that indicates if the HTTP request method is DELETE.
|
||||||
/// <summary/>
|
/// </summary>
|
||||||
/// <param name="method">The HTTP request method.</param>
|
/// <param name="method">The HTTP request method.</param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// <see langword="true" /> if the method is DELETE; otherwise, <see langword="false" />.
|
/// <see langword="true" /> if the method is DELETE; otherwise, <see langword="false" />.
|
||||||
|
|
@ -54,7 +54,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a value that indicates if the HTTP request method is GET.
|
/// Returns a value that indicates if the HTTP request method is GET.
|
||||||
/// <summary/>
|
/// </summary>
|
||||||
/// <param name="method">The HTTP request method.</param>
|
/// <param name="method">The HTTP request method.</param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// <see langword="true" /> if the method is GET; otherwise, <see langword="false" />.
|
/// <see langword="true" /> if the method is GET; otherwise, <see langword="false" />.
|
||||||
|
|
@ -66,7 +66,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a value that indicates if the HTTP request method is HEAD.
|
/// Returns a value that indicates if the HTTP request method is HEAD.
|
||||||
/// <summary/>
|
/// </summary>
|
||||||
/// <param name="method">The HTTP request method.</param>
|
/// <param name="method">The HTTP request method.</param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// <see langword="true" /> if the method is HEAD; otherwise, <see langword="false" />.
|
/// <see langword="true" /> if the method is HEAD; otherwise, <see langword="false" />.
|
||||||
|
|
@ -78,7 +78,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a value that indicates if the HTTP request method is OPTIONS.
|
/// Returns a value that indicates if the HTTP request method is OPTIONS.
|
||||||
/// <summary/>
|
/// </summary>
|
||||||
/// <param name="method">The HTTP request method.</param>
|
/// <param name="method">The HTTP request method.</param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// <see langword="true" /> if the method is OPTIONS; otherwise, <see langword="false" />.
|
/// <see langword="true" /> if the method is OPTIONS; otherwise, <see langword="false" />.
|
||||||
|
|
@ -90,7 +90,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a value that indicates if the HTTP request method is PATCH.
|
/// Returns a value that indicates if the HTTP request method is PATCH.
|
||||||
/// <summary/>
|
/// </summary>
|
||||||
/// <param name="method">The HTTP request method.</param>
|
/// <param name="method">The HTTP request method.</param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// <see langword="true" /> if the method is PATCH; otherwise, <see langword="false" />.
|
/// <see langword="true" /> if the method is PATCH; otherwise, <see langword="false" />.
|
||||||
|
|
@ -102,7 +102,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a value that indicates if the HTTP request method is POST.
|
/// Returns a value that indicates if the HTTP request method is POST.
|
||||||
/// <summary/>
|
/// </summary>
|
||||||
/// <param name="method">The HTTP request method.</param>
|
/// <param name="method">The HTTP request method.</param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// <see langword="true" /> if the method is POST; otherwise, <see langword="false" />.
|
/// <see langword="true" /> if the method is POST; otherwise, <see langword="false" />.
|
||||||
|
|
@ -114,7 +114,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a value that indicates if the HTTP request method is PUT.
|
/// Returns a value that indicates if the HTTP request method is PUT.
|
||||||
/// <summary/>
|
/// </summary>
|
||||||
/// <param name="method">The HTTP request method.</param>
|
/// <param name="method">The HTTP request method.</param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// <see langword="true" /> if the method is PUT; otherwise, <see langword="false" />.
|
/// <see langword="true" /> if the method is PUT; otherwise, <see langword="false" />.
|
||||||
|
|
@ -126,7 +126,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a value that indicates if the HTTP request method is TRACE.
|
/// Returns a value that indicates if the HTTP request method is TRACE.
|
||||||
/// <summary/>
|
/// </summary>
|
||||||
/// <param name="method">The HTTP request method.</param>
|
/// <param name="method">The HTTP request method.</param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// <see langword="true" /> if the method is TRACE; otherwise, <see langword="false" />.
|
/// <see langword="true" /> if the method is TRACE; otherwise, <see langword="false" />.
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents an implementation of the HTTP Context class.
|
/// Represents an implementation of the HTTP Context class.
|
||||||
/// <summary/>
|
/// </summary>
|
||||||
public sealed class DefaultHttpContext : HttpContext
|
public sealed class DefaultHttpContext : HttpContext
|
||||||
{
|
{
|
||||||
// Lambdas hoisted to static readonly fields to improve inlining https://github.com/dotnet/roslyn/issues/13624
|
// Lambdas hoisted to static readonly fields to improve inlining https://github.com/dotnet/roslyn/issues/13624
|
||||||
|
|
@ -37,7 +37,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="DefaultHttpContext"/> class.
|
/// Initializes a new instance of the <see cref="DefaultHttpContext"/> class.
|
||||||
/// <summary/>
|
/// </summary>
|
||||||
public DefaultHttpContext()
|
public DefaultHttpContext()
|
||||||
: this(new FeatureCollection())
|
: this(new FeatureCollection())
|
||||||
{
|
{
|
||||||
|
|
@ -48,7 +48,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="DefaultHttpContext"/> class with provided features.
|
/// Initializes a new instance of the <see cref="DefaultHttpContext"/> class with provided features.
|
||||||
/// <summary/>
|
/// </summary>
|
||||||
/// <param name="features">Initial set of features for the <see cref="DefaultHttpContext"/>.</param>
|
/// <param name="features">Initial set of features for the <see cref="DefaultHttpContext"/>.</param>
|
||||||
public DefaultHttpContext(IFeatureCollection features)
|
public DefaultHttpContext(IFeatureCollection features)
|
||||||
{
|
{
|
||||||
|
|
@ -59,7 +59,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Reinitialize the current instant of the class with features passed in.
|
/// Reinitialize the current instant of the class with features passed in.
|
||||||
/// <summary/>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// This method allows the consumer to re-use the <see cref="DefaultHttpContext" /> for another request, rather than having to allocate a new instance.
|
/// This method allows the consumer to re-use the <see cref="DefaultHttpContext" /> for another request, rather than having to allocate a new instance.
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
|
|
@ -76,7 +76,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Uninitialize all the features in the <see cref="DefaultHttpContext" />.
|
/// Uninitialize all the features in the <see cref="DefaultHttpContext" />.
|
||||||
/// <summary/>
|
/// </summary>
|
||||||
public void Uninitialize()
|
public void Uninitialize()
|
||||||
{
|
{
|
||||||
_features = default;
|
_features = default;
|
||||||
|
|
@ -88,7 +88,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or set the <see cref="FormOptions" /> for this instance.
|
/// Gets or set the <see cref="FormOptions" /> for this instance.
|
||||||
/// <summary/>
|
/// </summary>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// <see cref="FormOptions"/>
|
/// <see cref="FormOptions"/>
|
||||||
/// </returns>
|
/// </returns>
|
||||||
|
|
@ -96,7 +96,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the <see cref="IServiceScopeFactory" /> for this instance.
|
/// Gets or sets the <see cref="IServiceScopeFactory" /> for this instance.
|
||||||
/// <summary/>
|
/// </summary>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// <see cref="IServiceScopeFactory"/>
|
/// <see cref="IServiceScopeFactory"/>
|
||||||
/// </returns>
|
/// </returns>
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Provides an implementation of <see cref="IHttpContextAccessor" /> based on the current execution context.
|
/// Provides an implementation of <see cref="IHttpContextAccessor" /> based on the current execution context.
|
||||||
/// <summary/>
|
/// </summary>
|
||||||
public class HttpContextAccessor : IHttpContextAccessor
|
public class HttpContextAccessor : IHttpContextAccessor
|
||||||
{
|
{
|
||||||
private static AsyncLocal<HttpContextHolder> _httpContextCurrent = new AsyncLocal<HttpContextHolder>();
|
private static AsyncLocal<HttpContextHolder> _httpContextCurrent = new AsyncLocal<HttpContextHolder>();
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents methods used to create an HTTP context object.
|
/// Represents methods used to create an HTTP context object.
|
||||||
/// <summary/>
|
/// </summary>
|
||||||
[Obsolete("This is obsolete and will be removed in a future version. Use DefaultHttpContextFactory instead.")]
|
[Obsolete("This is obsolete and will be removed in a future version. Use DefaultHttpContextFactory instead.")]
|
||||||
public class HttpContextFactory : IHttpContextFactory
|
public class HttpContextFactory : IHttpContextFactory
|
||||||
{
|
{
|
||||||
|
|
@ -20,7 +20,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the HttpContext class with options passed in.
|
/// Initializes a new instance of the HttpContext class with options passed in.
|
||||||
/// <summary/>
|
/// </summary>
|
||||||
/// <param name="formOptions">Options to set when instantianting the HTTP context object.</param>
|
/// <param name="formOptions">Options to set when instantianting the HTTP context object.</param>
|
||||||
public HttpContextFactory(IOptions<FormOptions> formOptions)
|
public HttpContextFactory(IOptions<FormOptions> formOptions)
|
||||||
: this(formOptions, serviceScopeFactory: null)
|
: this(formOptions, serviceScopeFactory: null)
|
||||||
|
|
@ -29,7 +29,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the DefaultHttpContext class with options passed in.
|
/// Initializes a new instance of the DefaultHttpContext class with options passed in.
|
||||||
/// <summary/>
|
/// </summary>
|
||||||
/// <param name="formOptions">Options to set when instantianting the HTTP context object.</param>
|
/// <param name="formOptions">Options to set when instantianting the HTTP context object.</param>
|
||||||
/// <param name="serviceScopeFactory">Factory object used to create the service scope for the HTTP context.</param>
|
/// <param name="serviceScopeFactory">Factory object used to create the service scope for the HTTP context.</param>
|
||||||
public HttpContextFactory(IOptions<FormOptions> formOptions, IServiceScopeFactory serviceScopeFactory)
|
public HttpContextFactory(IOptions<FormOptions> formOptions, IServiceScopeFactory serviceScopeFactory)
|
||||||
|
|
@ -39,7 +39,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the DefaultHttpContext class with options passed in.
|
/// Initializes a new instance of the DefaultHttpContext class with options passed in.
|
||||||
/// <summary/>
|
/// </summary>
|
||||||
/// <param name="formOptions">Options to set when instantianting the HTTP context object.</param>
|
/// <param name="formOptions">Options to set when instantianting the HTTP context object.</param>
|
||||||
/// <param name="httpContextAccessor">Object to be used to access the HTTP context instance.</param>
|
/// <param name="httpContextAccessor">Object to be used to access the HTTP context instance.</param>
|
||||||
public HttpContextFactory(IOptions<FormOptions> formOptions, IHttpContextAccessor httpContextAccessor)
|
public HttpContextFactory(IOptions<FormOptions> formOptions, IHttpContextAccessor httpContextAccessor)
|
||||||
|
|
@ -49,7 +49,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the DefaultHttpContext class with options passed in.
|
/// Initializes a new instance of the DefaultHttpContext class with options passed in.
|
||||||
/// <summary/>
|
/// </summary>
|
||||||
/// <param name="formOptions">Options to set when instantianting the HTTP context object.</param>
|
/// <param name="formOptions">Options to set when instantianting the HTTP context object.</param>
|
||||||
/// <param name="serviceScopeFactory">Factory object used to create the service scope for the HTTP context.</param>
|
/// <param name="serviceScopeFactory">Factory object used to create the service scope for the HTTP context.</param>
|
||||||
/// <param name="httpContextAccessor">Options to set when instantianting the Default HTTP context object.</param>
|
/// <param name="httpContextAccessor">Options to set when instantianting the Default HTTP context object.</param>
|
||||||
|
|
@ -72,7 +72,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the DefaultHttpContext class with options passed in.
|
/// Initializes a new instance of the DefaultHttpContext class with options passed in.
|
||||||
/// <summary/>
|
/// </summary>
|
||||||
/// <param name="featureCollection">Options to set when instantianting the Default HTTP context object.</param>
|
/// <param name="featureCollection">Options to set when instantianting the Default HTTP context object.</param>
|
||||||
public HttpContext Create(IFeatureCollection featureCollection)
|
public HttpContext Create(IFeatureCollection featureCollection)
|
||||||
{
|
{
|
||||||
|
|
@ -95,7 +95,7 @@ namespace Microsoft.AspNetCore.Http
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the HTTP context object to null for garbage collection.
|
/// Sets the HTTP context object to null for garbage collection.
|
||||||
/// <summary/>
|
/// </summary>
|
||||||
/// <param name="httpContext">HTTP context to dispose.</param>
|
/// <param name="httpContext">HTTP context to dispose.</param>
|
||||||
public void Dispose(HttpContext httpContext)
|
public void Dispose(HttpContext httpContext)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue