You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2010/04/09 16:59:38 UTC

svn commit: r932445 - in /ant/core/trunk/src: main/org/apache/tools/ant/taskdefs/Get.java tests/antunit/taskdefs/get-test.xml

Author: bodewig
Date: Fri Apr  9 14:59:38 2010
New Revision: 932445

URL: http://svn.apache.org/viewvc?rev=932445&view=rev
Log:
Most probably fix Issue 48972, will close it once I can enable the test and verify the fix (works with a different server)

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Get.java
    ant/core/trunk/src/tests/antunit/taskdefs/get-test.xml

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Get.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Get.java?rev=932445&r1=932444&r2=932445&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Get.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Get.java Fri Apr  9 14:59:38 2010
@@ -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;

Modified: ant/core/trunk/src/tests/antunit/taskdefs/get-test.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/get-test.xml?rev=932445&r1=932444&r2=932445&view=diff
==============================================================================
--- ant/core/trunk/src/tests/antunit/taskdefs/get-test.xml (original)
+++ ant/core/trunk/src/tests/antunit/taskdefs/get-test.xml Fri Apr  9 14:59:38 2010
@@ -96,4 +96,17 @@
       <au:assertFileExists file="${output}/downloads/index.html"/>
       <au:assertFileExists file="${output}/downloads/faq.html"/>
     </target>
+
+  <target name="XtestRelativeRedirect">
+    <get  src="${location}/local.cgi" dest="${output}/other.tmp"/>
+    <au:assertTrue>
+      <resourcecount count="1">
+        <restrict>
+          <file file="${output}/other.tmp" />
+          <contains text="local redirect succeeded"/>
+        </restrict>
+      </resourcecount>
+    </au:assertTrue>
+    <au:assertLogContains text="local.cgi moved to http" />  
+  </target>
 </project>