Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
QueryMatch.cs
1using System.Threading.Tasks;
2using System.Xml;
5
7{
12 {
16 public QueryMatch()
17 : base()
18 {
19 }
20
27 public QueryMatch(XmlElement Xml, WafAction Parent, WebApplicationFirewall Document)
28 : base(Xml, Parent, Document)
29 {
30 }
31
35 public override string LocalName => nameof(QueryMatch);
36
44 public override WafAction Create(XmlElement Xml, WafAction Parent, WebApplicationFirewall Document) => new QueryMatch(Xml, Parent, Document);
45
51 public override Task<WafResult?> Review(ProcessingState State)
52 {
53 if (State.Request.Header.TryGetQueryParameter(this.Name, out string Value))
54 return this.Review(State, Value);
55 else
56 return Task.FromResult<WafResult?>(null);
57 }
58 }
59}
bool TryGetQueryParameter(string QueryParameter, out string Value)
Tries to get the value of an individual query parameter, if available.
HttpRequestHeader Header
Request header.
Definition: HttpRequest.cs:182
Checks for a match against the Query of the request.
Definition: QueryMatch.cs:12
QueryMatch(XmlElement Xml, WafAction Parent, WebApplicationFirewall Document)
Checks for a match against the Query of the request.
Definition: QueryMatch.cs:27
override Task< WafResult?> Review(ProcessingState State)
Reviews the processing state, and returns a WAF result, if any.
Definition: QueryMatch.cs:51
QueryMatch()
Checks for a match against the Query of the request.
Definition: QueryMatch.cs:16
override WafAction Create(XmlElement Xml, WafAction Parent, WebApplicationFirewall Document)
Creates a WAF action from its XML definition.
override string LocalName
XML Local Name for the XML element defining the action.
Definition: QueryMatch.cs:35
Abstract base class for named Web Application Firewall conditions.
Contains the current state of a review process.
HttpRequest Request
Current HTTP Request
Abstract base class for Web Application Firewall actions.
Definition: WafAction.cs:17
WebApplicationFirewall Document
Web Application Firewall document.
Definition: WafAction.cs:60
Web Application Firewall for HttpServer.
WafResult
Actions that a Web Server can take after reviewing a request.