Skip to content

Commit

Permalink
Update LineConfig.java
Browse files Browse the repository at this point in the history
  • Loading branch information
bit4woo committed Mar 6, 2024
1 parent 3d230a1 commit 8ae8838
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/config/LineConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,9 @@ public static LineConfig FromJson(String instanceString) {// throws Exception {
public static boolean isRedirectToHttps(LineEntry item) {
if (item.getProtocol().equalsIgnoreCase("http")) {
if (400>item.getStatuscode() && item.getStatuscode() >=300) {
String locationUrl = item.getHeaderValueOf(false,"Location");
String locationUrl = item.getHeaderValueOf(false,"Location");//不包含默认端口
locationUrl = locationUrl.toLowerCase().replace("https://", "http://");
if (locationUrl.equalsIgnoreCase(item.getUrl())) {
if (locationUrl.equalsIgnoreCase(item.fetchUrlWithCommonFormate())) {
return true;
}
}
Expand Down Expand Up @@ -444,11 +444,12 @@ public static LineEntry doFilter(LineEntry entry) {
return entry;
}

/*显示出来,方便加入黑名单,提高下次请求的效率
if (entry.getStatuscode() == 403 && entry.getTitle().equals("Direct IP access not allowed | Cloudflare")) {
stdout.println(String.format("--- [%s] --- Direct Cloudflare IP access",entry.getUrl()));
entry.setCheckStatus(LineEntry.CheckStatus_Checked);
return entry;
}
}*/

//<head><title>403 Forbidden</title></head>
/*
Expand Down

0 comments on commit 8ae8838

Please sign in to comment.