From e98af38dfb5bf95bcbbae2b7de18bc839a8f2d05 Mon Sep 17 00:00:00 2001 From: JoyChou Date: Mon, 11 Sep 2017 11:46:20 +0800 Subject: [PATCH] fix location 30x status code --- .idea/workspace.xml | 143 +++++++++++++++++++----------------- src/main/java/security.java | 2 +- 2 files changed, 76 insertions(+), 69 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 91c3562..9cb4013 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,7 @@ - - - + @@ -30,11 +28,11 @@ - + - + @@ -44,8 +42,8 @@ - - + + @@ -53,11 +51,11 @@ - + - - + + @@ -69,7 +67,7 @@ - + @@ -105,10 +103,10 @@ @@ -119,7 +117,6 @@ DEFINITION_ORDER - - @@ -703,7 +670,7 @@ - + @@ -720,9 +687,8 @@ - + - @@ -735,6 +701,7 @@ + @@ -783,6 +750,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -866,7 +873,7 @@ - + @@ -874,22 +881,11 @@ - - - - - - - - - - - - - + + @@ -899,10 +895,21 @@ - + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/security.java b/src/main/java/security.java index c870cbe..e23c999 100644 --- a/src/main/java/security.java +++ b/src/main/java/security.java @@ -87,7 +87,7 @@ public class security { //connection.setRequestMethod("GET"); connection.connect(); // send dns request int responseCode = connection.getResponseCode(); // 发起网络请求 - if (responseCode >= 300 && responseCode < 400) { + if (responseCode >= 300 && responseCode <=307 && responseCode != 304 && responseCode != 306) { String redirectedUrl = connection.getHeaderField("Location"); if (null == redirectedUrl) break;