mirror of
https://e.coding.net/circlecloud/Yum.git
synced 2024-12-22 12:48:47 +00:00
feat: 新增307跳转支持
Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
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
Block a user