forked from bonesoul/uhttpsharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmptyHttpHeaders.cs
More file actions
39 lines (33 loc) · 1.04 KB
/
Copy pathEmptyHttpHeaders.cs
File metadata and controls
39 lines (33 loc) · 1.04 KB
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
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
namespace uhttpsharp.Headers
{
[DebuggerDisplay("Empty Headers")]
public class EmptyHttpHeaders : IHttpHeaders
{
public static readonly IHttpHeaders Empty = new EmptyHttpHeaders();
private static readonly IEnumerable<KeyValuePair<string, string>> EmptyKeyValuePairs = new KeyValuePair<string, string>[0];
private EmptyHttpHeaders()
{
}
public IEnumerator<KeyValuePair<string, string>> GetEnumerator()
{
return EmptyKeyValuePairs.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return EmptyKeyValuePairs.GetEnumerator();
}
public string GetByName(string name)
{
throw new ArgumentException("EmptyHttpHeaders does not contain any header");
}
public bool TryGetByName(string name, out string value)
{
value = null;
return false;
}
}
}