forked from jexuswebserver/JexusManager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHeadersItem.cs
47 lines (37 loc) · 1.17 KB
/
HeadersItem.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (c) Lex Li. All rights reserved.
//
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace JexusManager.Features.RequestFiltering
{
using Microsoft.Web.Administration;
internal class HeadersItem : IItem<HeadersItem>
{
public ConfigurationElement Element { get; set; }
public bool Match(HeadersItem other)
{
return other != null && other.Header == Header;
}
public HeadersItem(ConfigurationElement element)
{
this.Element = element;
if (element == null)
{
return;
}
Header = (string)element["header"];
SizeLimit = (uint)element["sizeLimit"];
}
public uint SizeLimit { get; set; }
public string Header { get; set; }
public void Apply()
{
Element["header"] = Header;
Element["sizeLimit"] = SizeLimit;
}
public string Flag { get; set; }
public bool Equals(HeadersItem other)
{
return Match(other) && other.SizeLimit == SizeLimit;
}
}
}