mirror of https://e.coding.net/circlecloud/Yum.git
parent
66c7508009
commit
adea1e58e0
|
@ -271,8 +271,8 @@ public class DownloadManager {
|
|||
*/
|
||||
private URLConnection reload(final CommandSender sender, final URLConnection uc) throws Exception {
|
||||
final HttpURLConnection huc = (HttpURLConnection) uc;
|
||||
// 302, 301
|
||||
if (huc.getResponseCode() == HttpURLConnection.HTTP_MOVED_TEMP || huc.getResponseCode() == HttpURLConnection.HTTP_MOVED_PERM) {
|
||||
// 302, 301, 307
|
||||
if (huc.getResponseCode() == HttpURLConnection.HTTP_MOVED_TEMP || huc.getResponseCode() == HttpURLConnection.HTTP_MOVED_PERM || huc.getResponseCode() == 307) {
|
||||
final String url = huc.getHeaderField("Location");
|
||||
sender.sendMessage("§6跳转至地址: §3" + url);
|
||||
return reload(sender, new URL(url).openConnection());
|
||||
|
|
Loading…
Reference in New Issue