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
8a4992f1
Commit
8a4992f1
authored
May 22, 2017
by
justcoding121
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update logic
parent
270229e7
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 @
8a4992f1
...
...
@@ -60,31 +60,15 @@ namespace Titanium.Web.Proxy.Helpers
/// <returns></returns>
internal
static
string
GetWildCardDomainName
(
string
hostname
)
{
/*all needed domain in lower case*/
/*for now just hard code most common ones */
string
[]
col
=
{
".com"
,
".net"
,
".org"
,
".cn"
,
".us"
,
".in"
,
".co.uk"
,
".co.in"
,
".co.us"
};
foreach
(
string
name
in
col
)
//only for subdomains we need wild card
//example www.google.com or gstatic.google.com
//but NOT for google.com
if
(
hostname
.
Split
(
ProxyConstants
.
DotSplit
).
Length
>
2
)
{
if
(
hostname
.
EndsWith
(
name
))
{
int
idx
=
hostname
.
LastIndexOf
(
name
);
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
;
}
int
idx
=
hostname
.
IndexOf
(
ProxyConstants
.
DotSplit
);
var
rootDomain
=
hostname
.
Substring
(
idx
+
1
);
return
"*."
+
rootDomain
;
break
;
}
}
//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