Skip to content

Commit

Permalink
Handling redirection 302 #97
Browse files Browse the repository at this point in the history
  • Loading branch information
pkiraly committed Oct 2, 2023
1 parent 98414eb commit 1fe9aa7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static String getContentType(String url) throws IOException {
String rawContentType = urlConnection.getHeaderField("Content-Type");
if (rawContentType != null && StringUtils.isNotBlank(rawContentType))
contentType = rawContentType.replaceAll("; ?charset.*$", "");
} else if (responseCode == 301 || responseCode == 303) {
} else if (responseCode == 301 || responseCode == 302 || responseCode == 303) {
String location = urlConnection.getHeaderField("Location");
return getContentType(location);
} else {
Expand Down

0 comments on commit 1fe9aa7

Please sign in to comment.