Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
HeaderMatch.cs
1using System.Threading.Tasks;
2using System.Xml;
5
7{
12 {
16 public HeaderMatch()
17 : base()
18 {
19 }
20
27 public HeaderMatch(XmlElement Xml, WafAction Parent, WebApplicationFirewall Document)
28 : base(Xml, Parent, Document)
29 {
30 }
31
35 public override string LocalName => nameof(HeaderMatch);
36
44 public override WafAction Create(XmlElement Xml, WafAction Parent, WebApplicationFirewall Document) => new HeaderMatch(Xml, Parent, Document);
45
51 public override Task<WafResult?> Review(ProcessingState State)
52 {
53 if (State.Request.Header.TryGetHeaderField(this.Name, out HttpField Field))
54 return this.Review(State, Field.Value);
55 else
56 return Task.FromResult<WafResult?>(null);
57 }
58 }
59}
Base class for all HTTP fields.
Definition: HttpField.cs:7
bool TryGetHeaderField(string FieldName, out HttpField Field)
Tries to get a named header field.
Definition: HttpHeader.cs:247
HttpRequestHeader Header
Request header.
Definition: HttpRequest.cs:182
Checks for a match against the Header of the request.
Definition: HeaderMatch.cs:12
HeaderMatch()
Checks for a match against the Header of the request.
Definition: HeaderMatch.cs:16
override Task< WafResult?> Review(ProcessingState State)
Reviews the processing state, and returns a WAF result, if any.
Definition: HeaderMatch.cs:51
HeaderMatch(XmlElement Xml, WafAction Parent, WebApplicationFirewall Document)
Checks for a match against the Header of the request.
Definition: HeaderMatch.cs:27
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: HeaderMatch.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.