diff options
| author | Jaikiran Pai <jaikiran@apache.org> | 2021-08-09 17:06:29 +0530 |
|---|---|---|
| committer | Jaikiran Pai <jaikiran@apache.org> | 2021-08-09 17:09:03 +0530 |
| commit | 83b157b47fbbbdee6263b83fde487dc613015652 (patch) | |
| tree | a690514d650a5d34f2e7f8af5b4d35410495bfae /src/tests/antunit/taskdefs/condition | |
| parent | 750a94c35b11acb064ed572d506091abfba33916 (diff) | |
| download | ant-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.xml | 34 |
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> |
