Browse Source

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
master
Stefan Bodewig 15 years ago
parent
commit
ca1c170b4e
2 changed files with 14 additions and 1 deletions
  1. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/Get.java
  2. +13
    -0
      src/tests/antunit/taskdefs/get-test.xml

+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/Get.java View File

@@ -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;


+ 13
- 0
src/tests/antunit/taskdefs/get-test.xml View File

@@ -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>

Loading…
Cancel
Save