File tree Expand file tree Collapse file tree
cSploit/src/org/csploit/android/net/http Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -291,8 +291,6 @@ public class RequestParser
291291
292292
293293 public static String getBaseDomain (String hostname ){
294- String domain = "" ;
295-
296294 // if hostname is an IP address return that address
297295 if (Patterns .IP_ADDRESS .matcher (hostname ).matches ())
298296 return hostname ;
@@ -313,13 +311,19 @@ public static String getBaseDomain(String hostname){
313311 if ((ihost - itld ) == 0 || ihost == 2 )
314312 return hostname ;
315313
316- domain = "" ;
314+ StringBuilder sb = new StringBuilder ();
315+
317316 for (i = ihost - itld ; i < ihost ; i ++){
318- domain += host_parts [i ] + "." ;
317+ sb .append (host_parts [i ]);
318+ if (i < ihost - 1 ) {
319+ sb .append ("." );
320+ }
319321 }
320322
321- DNSCache .getInstance ().addRootDomain (domain .substring (0 , domain .length () - 1 ));
322- return domain .substring (0 , domain .length () - 1 );
323+ String domain = sb .toString ();
324+
325+ DNSCache .getInstance ().addRootDomain (domain );
326+ return domain ;
323327 }
324328 }
325329
You can’t perform that action at this time.
0 commit comments