forked from superuser5/HTTPS_CSharp_Server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CacheKey.cs
33 lines (29 loc) · 842 Bytes
/
CacheKey.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HTTPProxyServer
{
public class CacheKey
{
public String AbsoluteUri { get; set; }
public String UserAgent { get; set; }
public CacheKey(String requestUri, String userAgent)
{
AbsoluteUri = requestUri;
UserAgent = userAgent;
}
public override bool Equals(object obj)
{
CacheKey key = obj as CacheKey;
if (key != null)
return (key.AbsoluteUri == AbsoluteUri && key.UserAgent == UserAgent);
return false;
}
public override int GetHashCode()
{
String s = AbsoluteUri + UserAgent;
return s.GetHashCode();
}
}
}