Skip to content
This repository was archived by the owner on Jul 9, 2023. It is now read-only.

Commit 923a3bb

Browse files
fahlisaputrajustcoding121
authored andcommitted
Fix for #769: Wildcard bug on second-level domain
When openning second-level domain like ".ac.id, .co.id, .vn.ua, etc" it will show message "Couldn't authenticate host".
1 parent efecb69 commit 923a3bb

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/Titanium.Web.Proxy/Helpers/HttpHelper.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,14 @@ internal static string GetWildCardDomainName(string hostname)
150150

151151
if (hostname.Split(ProxyConstants.DotSplit).Length > 2)
152152
{
153+
// issue #769
154+
// do not create wildcard if second level domain like: .ac.id, .co.id
155+
string[] prefix = hostname.Split('.');
156+
if (prefix[1].Length <= 3)
157+
{
158+
return hostname;
159+
}
160+
153161
int idx = hostname.IndexOf(ProxyConstants.DotSplit);
154162

155163
// issue #352

0 commit comments

Comments
 (0)