Show / Hide Table of Contents

    Class UserAgentSentinelOptions

    Configuration options for UserAgentSentinelMiddleware.

    Inheritance
    System.Object
    UserAgentSentinelOptions
    Namespace: Cuemon.AspNetCore.Http.Headers
    Assembly: Cuemon.AspNetCore.dll
    Syntax
    public class UserAgentSentinelOptions

    Constructors

    | Improve this Doc

    UserAgentSentinelOptions()

    Initializes a new instance of the UserAgentSentinelOptions class.

    Declaration
    public UserAgentSentinelOptions()
    Remarks

    The following table shows the initial property values for an instance of UserAgentSentinelOptions.

    PropertyInitial Value
    AllowedUserAgentsnew List{string{>}();
    BadRequestMessageThe requirements of the HTTP User-Agent header was not met.
    ForbiddenMessageThe HTTP User-Agent specified was rejected.
    RequireUserAgentHeaderfalse
    ValidateUserAgentHeaderfalse
    ResponseBrokerA System.Net.Http.HttpResponseMessage initialized to either a HTTP status code 400 or 403 and a body of either BadRequestMessage or ForbiddenMessage.
    UseGenericResponsefalse

    Properties

    | Improve this Doc

    AllowedUserAgents

    Gets a list of whitelisted user agents.

    Declaration
    public IList<string> AllowedUserAgents { get; }
    Property Value
    Type Description
    System.Collections.Generic.IList<System.String>

    A list of whitelisted user agents.

    | Improve this Doc

    BadRequestMessage

    Gets or sets the message of a request missing the requirements of a User-Agent header.

    Declaration
    public string BadRequestMessage { get; set; }
    Property Value
    Type Description
    System.String

    The message of a request missing the requirements of a User-Agent header.

    | Improve this Doc

    ForbiddenMessage

    Gets or sets the message of a request without a valid User-Agent header.

    Declaration
    public string ForbiddenMessage { get; set; }
    Property Value
    Type Description
    System.String

    The message of a request without a valid User-Agent header.

    | Improve this Doc

    RequireUserAgentHeader

    Gets or sets a value indicating whether a HTTP User-Agent header must be present in the request.

    Declaration
    public bool RequireUserAgentHeader { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if the HTTP User-Agent header must be present in the request; otherwise, false.

    | Improve this Doc

    ResponseBroker

    Gets or sets the function delegate that configures the response in the form of a System.Net.Http.HttpResponseMessage.

    Declaration
    public Func<string, HttpResponseMessage> ResponseBroker { get; set; }
    Property Value
    Type Description
    System.Func<System.String, System.Net.Http.HttpResponseMessage>

    The function delegate that configures the response in the form of a System.Net.Http.HttpResponseMessage.

    | Improve this Doc

    UseGenericResponse

    Gets or sets a value indicating whether the produced ResponseBroker should be as neutral as possible.

    Declaration
    public bool UseGenericResponse { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if the produced ResponseBroker should be as neutral as possible; otherwise, false.

    | Improve this Doc

    ValidateUserAgentHeader

    Gets or sets a value indicating whether a HTTP User-Agent header must be validated against AllowedUserAgents.

    Declaration
    public bool ValidateUserAgentHeader { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if the HTTP User-Agent header must be validated against AllowedUserAgents; otherwise, false.

    Extension Methods

    CacheableObjectResultExtensions.ToCacheableObjectResult<T>(T, DateTime, Action<TimeBasedOptions>)
    CacheableObjectResultExtensions.ToCacheableObjectResult<T>(T, Func<T, DateTime>, Action<TimeBasedOptions>)
    CacheableObjectResultExtensions.ToCacheableObjectResult<T>(T, Byte[], Action<ContentBasedOptions>)
    CacheableObjectResultExtensions.ToCacheableObjectResult<T>(T, Func<T, Byte[]>, Action<ContentBasedOptions>)
    CacheableObjectResultExtensions.ToCacheableObjectResult<T>(T, DateTime, Byte[], Action<ContentTimeBasedOptions>)
    CacheableObjectResultExtensions.ToCacheableObjectResult<T>(T, Func<T, DateTime>, Func<T, Byte[]>, Action<ContentTimeBasedOptions>)
    CacheableObjectResultExtensions.ToCacheableObjectResult<T>(T, DateTime, Func<T, Byte[]>, Action<ContentTimeBasedOptions>)
    CacheableObjectResultExtensions.ToCacheableObjectResult<T>(T, Func<T, DateTime>, Byte[], Action<ContentTimeBasedOptions>)
    • Improve this Doc
    • View Source
    Back to top Copyright 2008-2018 Weubphoria. All rights reserved.
    Generated by DocFX