From ca1c170b4ee6e0e2be3319d89aceb0ee4ca42ab6 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Fri, 9 Apr 2010 14:59:38 +0000 Subject: [PATCH] Most probably fix Issue 48972, will close it once I can enable the test and verify the fix (works with a different server) git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@932445 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/taskdefs/Get.java | 2 +- src/tests/antunit/taskdefs/get-test.xml | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/Get.java b/src/main/org/apache/tools/ant/taskdefs/Get.java index 3906e88df..586a22239 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Get.java +++ b/src/main/org/apache/tools/ant/taskdefs/Get.java @@ -678,7 +678,7 @@ public class Get extends Task { + (responseCode == HttpURLConnection.HTTP_MOVED_PERM ? " permanently" : "") + " moved to " + newLocation; log(message, logLevel); - URL newURL = new URL(newLocation); + URL newURL = new URL(aSource, newLocation); if (!redirectionAllowed(aSource, newURL)) { return null; diff --git a/src/tests/antunit/taskdefs/get-test.xml b/src/tests/antunit/taskdefs/get-test.xml index 8f8a1f161..905a8eedc 100644 --- a/src/tests/antunit/taskdefs/get-test.xml +++ b/src/tests/antunit/taskdefs/get-test.xml @@ -96,4 +96,17 @@ + + + + + + + + + + + + +