Skip to content

Commit

Permalink
little speed up
Browse files Browse the repository at this point in the history
  • Loading branch information
tux-mind committed Mar 27, 2016
1 parent fa3f672 commit 96de421
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions cSploit/src/org/csploit/android/net/http/RequestParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,6 @@ public class RequestParser


public static String getBaseDomain(String hostname){
String domain = "";

// if hostname is an IP address return that address
if(Patterns.IP_ADDRESS.matcher(hostname).matches())
return hostname;
Expand All @@ -313,13 +311,19 @@ public static String getBaseDomain(String hostname){
if ((ihost - itld) == 0 || ihost == 2)
return hostname;

domain = "";
StringBuilder sb = new StringBuilder();

for(i = ihost - itld; i < ihost; i++){
domain += host_parts[i] + ".";
sb.append(host_parts[i]);
if(i < ihost - 1) {
sb.append(".");
}
}

DNSCache.getInstance().addRootDomain(domain.substring(0, domain.length() - 1));
return domain.substring(0, domain.length() - 1);
String domain = sb.toString();

DNSCache.getInstance().addRootDomain(domain);
return domain;
}
}

Expand Down

0 comments on commit 96de421

Please sign in to comment.