ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r932445 - in /ant/core/trunk/src: main/org/apache/tools/ant/taskdefs/Get.java tests/antunit/taskdefs/get-test.xml
Date Fri, 09 Apr 2010 14:59:38 GMT
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>



Mime
View raw message