Merge pull request #79 from Orange-OpenSource/feature/test-integ-max-redirect

Add test integ max-redirect
This commit is contained in:
Fabrice Reix 2020-11-15 09:50:03 +01:00 committed by GitHub
commit f2a742d9b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,7 @@
error: Http Connection
--> tests/error_max_redirect.hurl:1:5
|
1 | GET http://localhost:8000/redirect/7
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Too many redirect
|

View File

@ -0,0 +1,2 @@
3

View File

@ -0,0 +1 @@
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="string">http://localhost:8000/redirect/7</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span></div></div></div>

View File

@ -0,0 +1,4 @@
GET http://localhost:8000/redirect/7
HTTP/1.0 200

View File

@ -0,0 +1 @@
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/redirect/7"},"response":{"version":"HTTP/1.0","status":200}}]}

View File

@ -0,0 +1,2 @@
--location --max-redirs 5

View File

@ -0,0 +1,11 @@
from tests import app
from flask import redirect
@app.route('/redirect/<number>', methods=['GET'])
def redirect_n(number):
n = int(number)
if n == 0:
return ''
return redirect('http://localhost:8000/redirect/' + str(n-1))