Commit 96de421 1 parent fa3f672 commit 96de421 Copy full SHA for 96de421
File tree 1 file changed +10
-6
lines changed
cSploit/src/org/csploit/android/net/http
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -291,8 +291,6 @@ public class RequestParser
291
291
292
292
293
293
public static String getBaseDomain (String hostname ){
294
- String domain = "" ;
295
-
296
294
// if hostname is an IP address return that address
297
295
if (Patterns .IP_ADDRESS .matcher (hostname ).matches ())
298
296
return hostname ;
@@ -313,13 +311,19 @@ public static String getBaseDomain(String hostname){
313
311
if ((ihost - itld ) == 0 || ihost == 2 )
314
312
return hostname ;
315
313
316
- domain = "" ;
314
+ StringBuilder sb = new StringBuilder ();
315
+
317
316
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
+ }
319
321
}
320
322
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 ;
323
327
}
324
328
}
325
329
You can’t perform that action at this time.
0 commit comments