NamespaceSystemLibrary.Common.Framework.App.Attributes
Filters access based on User-Agent
header
NOTE: If attribute is added it blocks most known spiders, crawlers and bots even if you allow all
Input:
`null`: Allows all`*`: Allows all
- A regex: Value must satisfy the regex pattern- A pipe separated list: Any part is within the Value in a case insensitive check
`text`: Value must match, case sensitive[UserAgentFilter(null)] // Allows all
[UserAgentFilter("*")] // Allows all
[UserAgentFilter("^[ab0-4]{4,}$")] // Allow user agents containing only `a, b, 0, 1, 2, 3 or 4` with a minimum length of 4
[UserAgentFilter("User Agent")] // Exact match of 'User Agent', case sensitive
[UserAgentFilter("firefox|edg|chrome")] // Allow user agents containing firefox or edg or chrome, case insensitive
Remarks
Validating as a regex expression requires any of these characters: ^$*?[
Validate case insensitive with a string.Contains match requires at least one delimiter |
Falls back to normal string equals comparison, case sensitive
UserAgentFilterAttribute
public class UserAgentFilterAttribute : BaseApiFilterAttribute, IActionFilter, IAsyncActionFilter, IResultFilter, IAsyncResultFilter, IOrderedFilter, IFilterMetadata
Implements
Inherited Members
Constructors
Remarks
Validating as a regex expression requires any of these characters: ^$*?[
Validate case insensitive with a string.Contains match requires at least one delimiter |
Falls back to normal string equals comparison, case sensitive
Methods
Remarks
Validating as a regex expression requires any of these characters: ^$*?[
Validate case insensitive with a string.Contains match requires at least one delimiter |
Falls back to normal string equals comparison, case sensitive
Overrides
Implements
Extension Methods
}