summaryrefslogtreecommitdiff
path: root/src/tests/antunit/taskdefs/condition
diff options
context:
space:
mode:
authorJaikiran Pai <jaikiran@apache.org>2021-08-09 17:06:29 +0530
committerJaikiran Pai <jaikiran@apache.org>2021-08-09 17:09:03 +0530
commit83b157b47fbbbdee6263b83fde487dc613015652 (patch)
treea690514d650a5d34f2e7f8af5b4d35410495bfae /src/tests/antunit/taskdefs/condition
parent750a94c35b11acb064ed572d506091abfba33916 (diff)
downloadant-83b157b47fbbbdee6263b83fde487dc613015652.tar.gz
bz-65489 http condition - don't follow redirects when followRedirects is set to false
Diffstat (limited to 'src/tests/antunit/taskdefs/condition')
-rw-r--r--src/tests/antunit/taskdefs/condition/http-test.xml34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/tests/antunit/taskdefs/condition/http-test.xml b/src/tests/antunit/taskdefs/condition/http-test.xml
index 91ec866bd..1b9f133e1 100644
--- a/src/tests/antunit/taskdefs/condition/http-test.xml
+++ b/src/tests/antunit/taskdefs/condition/http-test.xml
@@ -68,4 +68,38 @@
text="Result code for ${unsecurelocation} was 200" />
</target>
+ <target name="testDontFollowPermanentRedirect">
+ <sleep milliseconds="250"/>
+ <au:assertTrue>
+ <http url="${location}/permanent.txt" followRedirects="false"/>
+ </au:assertTrue>
+ <au:assertLogContains level="verbose"
+ text="Result code for ${location}/permanent.txt was 301" />
+ </target>
+
+ <target name="testDontFollowTemporaryRedirect">
+ <sleep milliseconds="250"/>
+ <au:assertTrue>
+ <http url="${location}/temp.txt" followRedirects="false"/>
+ </au:assertTrue>
+ <au:assertLogContains level="verbose"
+ text="Result code for ${location}/temp.txt was 302" />
+ </target>
+
+ <target name="testDontFollowStatusCode307Redirect">
+ <sleep milliseconds="250"/>
+ <au:assertTrue>
+ <http url="${location}/307.txt" followRedirects="false"/>
+ </au:assertTrue>
+ <au:assertLogContains level="verbose"
+ text="Result code for ${location}/307.txt was 307" />
+ </target>
+
+ <target name="testDontFollowHttpToHttpsRedirect">
+ <sleep milliseconds="250"/>
+ <au:assertTrue>
+ <http url="${unsecurelocation}" followRedirects="false"/>
+ </au:assertTrue>
+ </target>
+
</project>