Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Redirection Feature (New PR) #10

Merged
merged 1 commit into from
Sep 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/osd/CmdLC.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ public void urlTest(String link) throws MalformedURLException {
else if(responseCode == HttpURLConnection.HTTP_MOVED_PERM || responseCode == 307 || responseCode == 308) { //301 Moved Permanently

String str = "@|yellow " + "[" + responseCode + "]" + " REDIRECT " + link + " |@";
System.out.println(Ansi.AUTO.string(str));
System.out.println(Ansi.AUTO.string(str));

// issue-6 redirection by Eunbee Kim
String redirectURL = huc.getHeaderField("Location");
urlTest(redirectURL);
}

else if(responseCode == HttpURLConnection.HTTP_NOT_FOUND || responseCode == HttpURLConnection.HTTP_BAD_REQUEST) { //400 HTTP_BAD_REQUEST , 404 HTTP_NOT_FOUND
Expand Down