Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
Titanium-Web-Proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Titanium-Web-Proxy
Commits
1866533e
Commit
1866533e
authored
May 22, 2017
by
justcoding121
Committed by
justcoding121
May 22, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update logic
parent
9904f66e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
23 deletions
+7
-23
HttpHelper.cs
Titanium.Web.Proxy/Helpers/HttpHelper.cs
+7
-23
No files found.
Titanium.Web.Proxy/Helpers/HttpHelper.cs
View file @
1866533e
...
@@ -60,31 +60,15 @@ namespace Titanium.Web.Proxy.Helpers
...
@@ -60,31 +60,15 @@ namespace Titanium.Web.Proxy.Helpers
/// <returns></returns>
/// <returns></returns>
internal
static
string
GetWildCardDomainName
(
string
hostname
)
internal
static
string
GetWildCardDomainName
(
string
hostname
)
{
{
/*all needed domain in lower case*/
//only for subdomains we need wild card
/*for now just hard code most common ones */
//example www.google.com or gstatic.google.com
string
[]
col
=
{
".com"
,
".net"
,
".org"
,
//but NOT for google.com
".cn"
,
".us"
,
".in"
,
if
(
hostname
.
Split
(
ProxyConstants
.
DotSplit
).
Length
>
2
)
".co.uk"
,
".co.in"
,
".co.us"
};
foreach
(
string
name
in
col
)
{
{
if
(
hostname
.
EndsWith
(
name
))
int
idx
=
hostname
.
IndexOf
(
ProxyConstants
.
DotSplit
);
{
var
rootDomain
=
hostname
.
Substring
(
idx
+
1
);
int
idx
=
hostname
.
LastIndexOf
(
name
);
return
"*."
+
rootDomain
;
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
(
"."
))
{
var
rootDomain
=
hostname
.
Substring
(
sec
+
1
);
return
"*."
+
rootDomain
;
}
break
;
}
}
}
//return as it is
//return as it is
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment