Commit 9904f66e authored by justcoding121's avatar justcoding121 Committed by justcoding121

add comments

parent 477a3d24
...@@ -62,8 +62,10 @@ namespace Titanium.Web.Proxy.Helpers ...@@ -62,8 +62,10 @@ namespace Titanium.Web.Proxy.Helpers
{ {
/*all needed domain in lower case*/ /*all needed domain in lower case*/
/*for now just hard code most common ones */ /*for now just hard code most common ones */
string[] col = { ".com", ".net", ".org", ".cn", string[] col = { ".com", ".net", ".org",
".co.uk", ".co.in", ".co.us" }; ".cn", ".us", ".in",
".co.uk", ".co.in", ".co.us"
};
foreach (string name in col) foreach (string name in col)
{ {
...@@ -72,6 +74,9 @@ namespace Titanium.Web.Proxy.Helpers ...@@ -72,6 +74,9 @@ namespace Titanium.Web.Proxy.Helpers
int idx = hostname.LastIndexOf(name); int idx = hostname.LastIndexOf(name);
int sec = hostname.Substring(0, idx - 1).LastIndexOf('.'); int sec = hostname.Substring(0, idx - 1).LastIndexOf('.');
//only for subdomains we need wild card
//example www.google.com or gstatic.google.com
//but NOT for google.com
if(hostname.Substring(0, sec + 1).Contains(".")) if(hostname.Substring(0, sec + 1).Contains("."))
{ {
var rootDomain = hostname.Substring(sec + 1); var rootDomain = hostname.Substring(sec + 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment