We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 18a6395 commit 7f8ea0aCopy full SHA for 7f8ea0a
cSploit/src/main/java/org/csploit/android/net/http/RequestParser.java
@@ -300,15 +300,17 @@ public static String getBaseDomain(String hostname){
300
tld_parts = tld.split("\\.");
301
int itld = tld_parts.length,
302
ihost = host_parts.length,
303
- i = 0,
304
- stop = ihost - 1;
+ i = 0;
+
305
+ if ((ihost - itld) == 0)
306
+ return hostname;
307
308
domain = "";
- for(i = ihost - itld; i <= stop; i++){
- domain += host_parts[i] + (i == stop ? "" : ".");
309
+ for(i = ihost - itld - 1; i < ihost; i++){
310
+ domain += host_parts[i] + ".";
311
}
312
- return domain;
313
+ return domain.substring(0, domain.length() - 1);
314
315
316
0 commit comments